Files
kotlin/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/When.kt
2015-06-02 10:56:21 +03:00

19 lines
393 B
Kotlin
Vendored

fun bar(x: Int): Int = x + 1
fun foo() {
val x: Int? = null
if (x != null) {
when (<!DEBUG_INFO_SMARTCAST!>x<!>) {
0 -> bar(<!DEBUG_INFO_SMARTCAST!>x<!>)
else -> {}
}
}
when (x) {
0 -> { if (<!SENSELESS_COMPARISON!>x == null<!>) return }
else -> { if (x == null) return }
}
bar(<!DEBUG_INFO_SMARTCAST!>x<!>)
}