FIR: report UNSAFE_CALL on dot when possible

This commit is contained in:
Mikhail Glukhikh
2021-01-29 10:25:59 +03:00
parent 0ee4f1f393
commit 7d4eaefd36
249 changed files with 1208 additions and 1649 deletions
@@ -14,14 +14,14 @@ fun test1(x: ClassLevel1?) {
fun case_2(x: Any?) {
(x as ClassLevel1?)!!
<!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel1? & kotlin.Any?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel1? & kotlin.Any?")!>x<!>.<!UNSAFE_CALL!>test1<!>()
<!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel1? & kotlin.Any?")!>x<!><!UNSAFE_CALL!>.<!>test1()
}
// TESTCASE NUMBER: 3
fun case_3(x: Any?) {
if (x as ClassLevel1? is ClassLevel1) {
<!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel1? & kotlin.Any?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel1? & kotlin.Any?")!>x<!>.<!UNSAFE_CALL!>test1<!>()
<!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel1? & kotlin.Any?")!>x<!><!UNSAFE_CALL!>.<!>test1()
}
}
@@ -29,7 +29,7 @@ fun case_3(x: Any?) {
fun case_4(x: Any?) {
if ((x as Class).prop_8 != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("Class & kotlin.Any?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Class & kotlin.Any?")!>x<!>.prop_8.<!UNSAFE_CALL!>prop_8<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Class & kotlin.Any?")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8
}
}
@@ -37,6 +37,6 @@ fun case_4(x: Any?) {
fun case_5(x: Class) {
if (x!!.prop_8 != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("Class & Class")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Class & Class")!>x<!>.prop_8.<!UNSAFE_CALL!>prop_8<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Class & Class")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8
}
}