Report errors when iterator() returns a nullable type

This commit is contained in:
Andrey Breslav
2012-08-24 19:20:53 +04:00
parent b6f15b518a
commit c0c2ca0ac2
11 changed files with 54 additions and 45 deletions
@@ -66,14 +66,6 @@ fun box() : String {
System.out?.println(sum)
if(sum != 10) return "b failed"
val c7 = MyCollection5()
sum = 0
for (el in c7) {
sum = sum + el!!
}
if(sum != 0) return "c7 failed"
return "OK"
}
@@ -120,14 +112,3 @@ class MyCollection4() {
fun hasNext() = k > 0
}
}
class MyCollection5() {
fun iterator() : MyIterator? = null
class MyIterator() {
var k : Int = 5
fun next() : Int = k--
fun hasNext() = k > 0
}
}