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

11 lines
298 B
Kotlin
Vendored

fun x(): Boolean { return true }
public fun foo(p: String?): Int {
while(true) {
if (x()) break
// We do not always reach this statement
p!!.length
}
// Here we have while (true) loop but p is nullable due to break before
return p<!UNSAFE_CALL!>.<!>length
}