[FIR] Allow Int? === null

It was decided to allow this comparison
duting the last DM.

^KT-62646
This commit is contained in:
Nikolay Lunyak
2024-02-26 18:06:50 +02:00
committed by Space Team
parent 4abfb2534a
commit 6607c8a056
18 changed files with 172 additions and 171 deletions
@@ -133,7 +133,7 @@ fun case_9(list: List<Int?>) {
// TESTCASE NUMBER: 10
fun case_10(x: Float?) {
while (false) {
if (true && true && true && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x !== null<!>) else break
if (true && true && true && x !== null) else break
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float?")!>x<!><!UNSAFE_CALL!>.<!>equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float?")!>x<!>.propT
@@ -167,7 +167,7 @@ fun case_11(x: Out<*>?, list: List<Int>) {
// TESTCASE NUMBER: 12
fun case_12(list: List<Int?>) {
for (element in list) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>element === null<!>) continue
if (element === null) continue
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>element<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>element<!>.inv()
}
@@ -222,7 +222,7 @@ fun case_15(map: MutableMap<Int?, Int?>, y: Nothing?) {
// TESTCASE NUMBER: 16
fun case_16(map: Map<Int?, Int?>) {
for ((k, v) in map) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>k !== implicitNullableNothingProperty<!> && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>v !== implicitNullableNothingProperty<!>) else { continue }
if (k !== implicitNullableNothingProperty && v !== implicitNullableNothingProperty) else { continue }
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>k<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>k<!>.inv()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>v<!>