For-loop range expression (collection) can not be null
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
class Coll {
|
||||
fun iterator(): It = It()
|
||||
}
|
||||
|
||||
class It {
|
||||
fun next() = 1
|
||||
fun hasNext() = false
|
||||
}
|
||||
|
||||
fun test(c: Coll?) {
|
||||
for (x in <!ITERATOR_MISSING!>c<!>) {}
|
||||
|
||||
if (c != null) {
|
||||
for(x in c) {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user