Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/loops/elvisLeftBreakInsideWhileTrue.fir.kt
T

9 lines
323 B
Kotlin
Vendored

public fun foo(x: String?, y: String?): Int {
while (true) {
(if (x != null) break else y) ?: y!!
// y is not null in both branches but it's hard to determine
y.<!INAPPLICABLE_CANDIDATE!>length<!>
}
// y can be null because of the break
return y.<!INAPPLICABLE_CANDIDATE!>length<!>
}