[FIR] Don't create smartcast node if smartcasted type is equal to original type

This commit is contained in:
Dmitriy Novozhilov
2021-02-19 17:47:44 +03:00
parent 1c0d862e40
commit 469252f6b4
30 changed files with 272 additions and 271 deletions
@@ -6,7 +6,7 @@
fun case_1() {
var x: Int? = 11
x!!
try {x = null;} finally { <!UNRESOLVED_REFERENCE!><!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int?")!>x<!> += 10<!>; }
try {x = null;} finally { <!UNRESOLVED_REFERENCE!><!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!> += 10<!>; }
}
// TESTCASE NUMBER: 2
@@ -18,7 +18,7 @@ fun case_2() {
} catch (e: Exception) {
x = null
}
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
}
}
@@ -31,7 +31,7 @@ fun case_3() {
} catch (e: Exception) {
x = null
}
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
}
}
@@ -42,5 +42,5 @@ fun case_4() {
try {
x = null
} finally { }
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
}