Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/varnotnull/doWhileWithMiddleBreak.kt
T
2021-02-15 11:37:39 +03:00

13 lines
273 B
Kotlin
Vendored

// FIR_IDENTICAL
fun x(): Boolean { return true }
public fun foo(pp: String?): Int {
var p = pp
do {
p!!.length
if (p == "abc") break
p = null
} while (!x())
// Smart cast is NOT possible here
return p<!UNSAFE_CALL!>.<!>length
}