Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/varnotnull/doWhileWithMiddleBreak.fir.kt
T
2020-01-22 14:49:22 +03:00

12 lines
267 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.<!INAPPLICABLE_CANDIDATE!>length<!>
}