Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/variables/doWhileWithMiddleBreak.kt
T
2015-10-14 20:39:35 +03:00

12 lines
271 B
Kotlin
Vendored

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<!>()
}