FIR DFA: take all statements from ?. if result is non-null.

I.e. a?.f(b as T) != null => b is T.

This also allows to remove the copyAllInformationFrom hack by moving the
edge directly in the control flow graph.
This commit is contained in:
pyos
2022-11-19 19:13:27 +01:00
committed by teamcity
parent 3392e066df
commit 16b8811697
14 changed files with 278 additions and 245 deletions
@@ -1,7 +1,7 @@
// !DUMP_CFG
interface A {
fun foo(): A
fun bar(): A
fun bar(x: String): A
}
interface B {
@@ -10,9 +10,15 @@ interface B {
}
fun test_1(x: A?) {
x?.foo()?.bar()
x?.foo()?.bar("")
}
fun test_2(x: B?) {
x?.foo?.bar
}
fun test_3(x: A?, y: String?) {
if (x?.bar(y as String) != null) {
y.length
}
}