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

15 lines
349 B
Kotlin
Vendored

public fun foo(xx: Any): Int {
var x = xx
do {
var y: Any
// After the check, smart cast should work
if (x is String) {
y = "xyz"
} else {
y = "abc"
}
// y!! in both branches
y.length
} while (!(x is String))
return x.<!UNRESOLVED_REFERENCE!>length<!>
}