FIR DFA: when joining flows, clear reassigned vars with no statements

For example:

    val c = C("...")
    val x = c.x // alias to variable for c.x, which depends on c
    if (x == null) return
    // now c.x has type Any
    c = C(null)
    // c has been reassigned => info for c.x is no longer valid;
    // c itself has never had any statements made about it, but
    // we must still call removeAllAboutVariable to clear the
    // dependents
This commit is contained in:
pyos
2022-11-01 14:31:52 +01:00
committed by teamcity
parent 0781cd12d4
commit 639a454d6c
3 changed files with 35 additions and 61 deletions
@@ -36,5 +36,5 @@ fun test3(p: Boolean) {
c = C(null)
}
x.length // ok
c.x.length // bad
c.x<!UNSAFE_CALL!>.<!>length // bad
}