Files
kotlin-fork/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.fir.kt
T
2021-04-19 15:10:58 +03:00

17 lines
237 B
Kotlin
Vendored

class Coll {
operator fun iterator(): It = It()
}
class It {
operator fun next() = 1
operator fun hasNext() = false
}
fun test(c: Coll?) {
for (x in <!ITERATOR_ON_NULLABLE!>c<!>) {}
if (c != null) {
for(x in c) {}
}
}