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

10 lines
272 B
Kotlin
Vendored

// FIR_IDENTICAL
public fun foo(x: String?, y: String?): Int {
while (true) {
x ?: if (y == null) break
// y is nullable if x != null
y<!UNSAFE_CALL!>.<!>length
}
// y is null because of the break
return y<!UNSAFE_CALL!>.<!>length
}