Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/loops/nestedDoWhileWithLongContinue.kt
T
pyos f9745bd3f1 FIR DFA: make continue jump to condition entry, not loop entry
It's also not a backwards jump in do-while, unless it's in the loop's
condition, which is a stupid "feature" IMO. As you can probably tell
from the comments added in this commit.
2022-12-08 10:19:26 +00:00

14 lines
372 B
Kotlin
Vendored

fun x(): Boolean { return true }
public fun foo(p: String?, r: String?): Int {
outer@ do {
do {
p!!.length
if (!x()) continue@outer
} while (r == null)
} while (!x())
// Auto cast NOT possible due to long continue
r<!UNSAFE_CALL!>.<!>length
// Auto cast possible
return <!DEBUG_INFO_SMARTCAST!>p<!>.length
}