Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/loops/ifBlockInsideDoWhile.fir.kt
T

12 lines
272 B
Kotlin
Vendored

public fun foo(p: String?, y: String?): Int {
do {
// After the check, smart cast should work
if (y == null) {
"null".toString()
break
}
y.length
p!!.length
} while (true)
return y?.length ?: -1
}