Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/loops/leftElvisBreakInsideWhileTrue.fir.kt
T
2021-01-29 16:55:26 +03:00

11 lines
317 B
Kotlin
Vendored

public fun foo(x: String?, y: String?): Int {
while (true) {
val z = (if (y == null) break else x) ?: y
// z is not null in both branches
z.length
// y is not null in both branches
y.length
}
// y is null because of the break
return y<!UNSAFE_CALL!>.<!>length
}