FIR DFA: update assignment indices when joining flows

This commit is contained in:
pyos
2022-11-03 10:58:59 +01:00
committed by teamcity
parent 8e40566520
commit 20871dd555
4 changed files with 58 additions and 4 deletions
@@ -38,3 +38,26 @@ fun test3(p: Boolean) {
x.length // ok
c.x<!UNSAFE_CALL!>.<!>length // bad
}
fun test4(p: Boolean, q: Boolean) {
var c = C("...")
val x = c.x
if (x == null) return
x.length // ok
c.x.length // ok
if (p) {
if (q) {
c = C(null)
} else {
c = C(null)
}
} else {
if (q) {
c = C(null)
} else {
c = C(null)
}
}
x.length // ok
c.x<!UNSAFE_CALL!>.<!>length // bad
}
@@ -38,3 +38,26 @@ fun test3(p: Boolean) {
<!DEBUG_INFO_SMARTCAST!>x<!>.length // ok
c.x<!UNSAFE_CALL!>.<!>length // bad
}
fun test4(p: Boolean, q: Boolean) {
var c = C("...")
val x = c.x
if (x == null) return
<!DEBUG_INFO_SMARTCAST!>x<!>.length // ok
c.x<!UNSAFE_CALL!>.<!>length // ok
if (p) {
if (q) {
c = C(null)
} else {
c = C(null)
}
} else {
if (q) {
c = C(null)
} else {
c = C(null)
}
}
<!DEBUG_INFO_SMARTCAST!>x<!>.length // ok
c.x<!UNSAFE_CALL!>.<!>length // bad
}