For-loop range expression (collection) can not be null
This commit is contained in:
@@ -12,10 +12,5 @@ fun box() : String {
|
||||
System.out?.println(sum)
|
||||
if(sum != 10) return "b failed"
|
||||
|
||||
val d : Array<Int?>? = null
|
||||
for (el in d) {
|
||||
sum = sum + (el ?: 7)
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -10,10 +10,5 @@ fun box() : String {
|
||||
}
|
||||
if(sum != 10) return "a failed"
|
||||
|
||||
val b : IntArray? = null
|
||||
for (el in b) {
|
||||
sum = sum + el
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user