FIR DFA: smartcast variable to Nothing? on null assignment

In order to make resolution still work for members not available from
`Nothing`, we track the type without `Nothing?` and use that for
resolution instead.
This commit is contained in:
Tianyu Geng
2021-07-22 10:01:10 -07:00
committed by teamcityserver
parent 7e2f15f532
commit 4726dcce40
54 changed files with 334 additions and 320 deletions
@@ -18,8 +18,8 @@ fun case_1(x: ClassWithCustomEquals) {
// TESTCASE NUMBER: 2
fun case_2(x: ClassWithCustomEquals) {
if (x == null) {
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & ClassWithCustomEquals")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & ClassWithCustomEquals")!>x<!>.<!UNRESOLVED_REFERENCE!>inv<!>()
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & kotlin.Nothing")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & kotlin.Nothing")!>x<!>.inv()
}
}
@@ -76,8 +76,8 @@ fun case_6(x: ClassWithCustomEquals) {
// TESTCASE NUMBER: 7
fun case_7(x: ClassWithCustomEquals) {
if ((x != null) == false) {
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & ClassWithCustomEquals")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & ClassWithCustomEquals")!>x<!>.<!UNRESOLVED_REFERENCE!>inv<!>()
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & kotlin.Nothing")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & kotlin.Nothing")!>x<!>.inv()
}
}