Files
kotlin-fork/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/For.jet
T
2012-06-15 17:06:41 +04:00

25 lines
423 B
Plaintext

import java.util.HashMap
fun bar(x: Int): Int = x + 1
fun foo() {
val x: Int? = null
val a = Array<Int>(3, {0})
for (p in a) {
bar(<!TYPE_MISMATCH!>x<!>)
if (x == null) continue
bar(x)
for (q in a) {
bar(x)
if (x == null) bar(x)
}
}
for (p in a) {
bar(<!TYPE_MISMATCH!>x<!>)
if (x == null) break
bar(x)
}
}