Files
kotlin/compiler/testData/codegen/controlStructures/forNullableIntArray.kt
Alexander Udalov 0df71bd696 Refactor codegen tests
- initialize environment only once in setUp()
- add comments on why some tests are disabled
- modify and rename some tests
- re-enable now working tests
- extract some tests into files with box()
- remove useless 'throws' declarations and commented code
2013-01-24 21:12:27 +04:00

15 lines
264 B
Kotlin

fun box() : String {
val b : Array<Int?> = arrayOfNulls<Int> (5)
var i = 0
var sum = 0
while(i < 5) {
b[i] = i++
}
sum = 0
for (el in b) {
sum = sum + (el ?: 0)
}
if(sum != 10) return "b failed"
return "OK"
}