Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/smartcasts/withChangesToNull.fir.kt
T
pyos edaca59d83 FIR DFA: fork flow everywhere
In theory, forking persistent flows should be cheap because of object
reuse, so the proposal here is to start from scratch and prove
redundancy of forks on a case-by-case basis. Something something better
safe than sorry.

^KT-28333 tag fixed-in-k2
^KT-28489 tag fixed-in-k2
2022-11-22 15:44:32 +00:00

11 lines
250 B
Kotlin
Vendored

fun foo(y: String?) {
var x: String? = ""
if (x != null) {
with(y?.let { x = null; it }) {
this<!UNSAFE_CALL!>.<!>length
<!SMARTCAST_IMPOSSIBLE!>x<!>.length
}
x<!UNSAFE_CALL!>.<!>length
}
}