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

11 lines
269 B
Kotlin
Vendored

// FIR_IDENTICAL
fun x(): Boolean { return true }
public fun foo(p: String?): Int {
while(x()) {
p!!.length
if (x()) break
}
// p is nullable because it's possible loop body is not executed at all
return p<!UNSAFE_CALL!>.<!>length
}