17 lines
237 B
Kotlin
Vendored
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) {}
|
|
}
|
|
}
|