Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/loops/WhileTrueWithBreakInIfCondition.kt
T
2016-01-22 16:37:07 +03:00

14 lines
299 B
Kotlin
Vendored

fun checkJump(x: Int?, y: Int?) {
while (true) {
if (x ?: break == 0) {
y!!
} else {
y!!
}
// Ok
<!DEBUG_INFO_SMARTCAST!>y<!>.hashCode()
}
// Smart cast here is erroneous: y is nullable
y<!UNSAFE_CALL!>.<!>hashCode()
}