Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/loops/elvisBreakInsideDoWhile.kt
T
2015-10-14 20:39:35 +03:00

10 lines
295 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
<!DEBUG_INFO_SMARTCAST!>x<!>.length
} while (true)
// x is null because of the break
return x<!UNSAFE_CALL!>.<!>length
}