Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/loops/whileSimple.fir.kt
T
Dmitriy Novozhilov 6735cc8937 [FIR] Implement new bound smartcast algorithm
#KT-36055 Fixed
2020-02-12 10:17:45 +03:00

10 lines
263 B
Kotlin
Vendored

fun x(): Boolean { return true }
public fun foo(p: String?): Int {
while(x()) {
p!!.length
if (x()) break
}
// p is nullable because it's possible loop body is not executed at all
return p.<!INAPPLICABLE_CANDIDATE!>length<!>
}