Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/variables/doWhileWithMiddleBreak.kt
T

13 lines
288 B
Kotlin
Vendored

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