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

10 lines
268 B
Kotlin
Vendored

public fun foo(x: String?): Int {
do {
// After the check, smart cast should work
x ?: break
// x is not null in both branches
x.length
} while (true)
// x is null because of the break
return x<!UNSAFE_CALL!>.<!>length
}