[FIR] Fix clearing info about DF variable after reassignment

This commit is contained in:
Dmitriy Novozhilov
2021-03-04 11:50:56 +03:00
parent f8adce8b96
commit a6d1d47918
19 changed files with 181 additions and 15 deletions
@@ -0,0 +1,21 @@
abstract class A {
abstract fun foo(): String
}
class B : A() {
override fun foo() = "OK"
}
class C : A() {
override fun foo() = "fail"
}
fun test(c: C, cond: Boolean): String {
var x: A = c
if (cond) {
x = B()
}
return x.foo()
}
fun box(): String = test(C(), true)