Files
kotlin-fork/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/When.jet
T
2012-06-21 22:38:11 +04:00

19 lines
312 B
Plaintext

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