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

14 lines
363 B
Kotlin
Vendored

fun bar(): Boolean { return true }
fun gav(z: String, arg: Any): String { return if (arg is String) arg else z }
public fun foo(x: String?, z: String?): Int {
do {
gav(z!!, if (x == null) break else x)
} while (bar())
// z is not null because of z!!
z.length
// x is null because of the break
return x<!UNSAFE_CALL!>.<!>length
}