Files
kotlin-fork/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/While.kt
T
2014-10-01 18:52:52 +04:00

23 lines
439 B
Kotlin
Vendored

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