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

12 lines
256 B
Kotlin
Vendored

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
}