Files
kotlin-fork/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/While.kt
T
2013-12-11 19:53:50 +04:00

23 lines
437 B
Kotlin

fun bar(x: Int): Int = x + 1
fun foo() {
val x: Int? = null
while (x == null) {
bar(<!TYPE_MISMATCH!>x<!>)
}
bar(<!DEBUG_INFO_AUTOCAST!>x<!>)
val y: Int? = null
while (y != null) {
bar(<!DEBUG_INFO_AUTOCAST!>y<!>)
}
bar(<!TYPE_MISMATCH!>y<!>)
val z: Int? = null
while (z == null) {
bar(<!TYPE_MISMATCH!>z<!>)
break
}
bar(<!TYPE_MISMATCH!>z<!>)
}