For-loop range expression (collection) can not be null

This commit is contained in:
Andrey Breslav
2012-08-24 15:36:55 +04:00
parent b315bee7b2
commit 66faa0c03a
24 changed files with 39 additions and 60 deletions
@@ -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) {}
}
}