mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 00:21:29 +00:00
KT-531 Support nullable iterator in for()
This commit is contained in:
@@ -12,5 +12,10 @@ 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"
|
||||
}
|
||||
Reference in New Issue
Block a user