[FIR] Allow Int? === null
It was decided to allow this comparison duting the last DM. ^KT-62646
This commit is contained in:
committed by
Space Team
parent
4abfb2534a
commit
6607c8a056
@@ -178,7 +178,7 @@ fun case_9(x: TypealiasNullableString<!REDUNDANT_NULLABLE!>?<!>) {
|
||||
fun case_10() {
|
||||
val a = Class()
|
||||
|
||||
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.prop_4 === null<!> || <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>a.prop_4 === null<!> || true) {
|
||||
if (a.prop_4 === null || <!SENSELESS_COMPARISON!>a.prop_4 === null<!> || true) {
|
||||
if (a.prop_4 != null) {
|
||||
a.prop_4
|
||||
a.prop_4.equals(null)
|
||||
@@ -300,7 +300,7 @@ fun case_16() {
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 17
|
||||
val case_17 = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>if (nullableIntProperty == null || <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>nullableNothingProperty === nullableIntProperty<!>) 0 else {
|
||||
val case_17 = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>if (nullableIntProperty == null || <!SENSELESS_COMPARISON!>nullableNothingProperty === nullableIntProperty<!>) 0 else {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>nullableIntProperty<!>.equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>nullableIntProperty<!>.propT
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>nullableIntProperty<!>.propAny
|
||||
@@ -398,7 +398,7 @@ fun case_20(b: Boolean) {
|
||||
// TESTCASE NUMBER: 21
|
||||
fun case_21() {
|
||||
val y = null
|
||||
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>EnumClassWithNullableProperty.A.prop_1 !== null<!> && <!SENSELESS_COMPARISON!>y != EnumClassWithNullableProperty.A.prop_1<!>) {
|
||||
if (EnumClassWithNullableProperty.A.prop_1 !== null && <!SENSELESS_COMPARISON!>y != EnumClassWithNullableProperty.A.prop_1<!>) {
|
||||
EnumClassWithNullableProperty.A.prop_1
|
||||
EnumClassWithNullableProperty.A.prop_1.equals(null)
|
||||
EnumClassWithNullableProperty.A.prop_1.propT
|
||||
@@ -431,9 +431,9 @@ fun case_22(a: (() -> Unit)?) {
|
||||
|
||||
// TESTCASE NUMBER: 23
|
||||
fun case_23(a: ((Float) -> Int?)?, b: Float?, c: Nothing?) {
|
||||
if (a != null && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>b !== null<!> || a != c && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>b !== c<!>) {
|
||||
if (a != null && b !== null || a != c && b !== c) {
|
||||
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>b<!>)<!>
|
||||
if (x != null || <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>c !== x<!>) {
|
||||
if (x != null || <!SENSELESS_COMPARISON!>c !== x<!>) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>.equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>.propT
|
||||
@@ -543,7 +543,7 @@ fun case_27(y: Nothing?) {
|
||||
|
||||
//TESTCASE NUMBER: 28
|
||||
fun case_28(a: DeepObject.A.B.C.D.E.F.G.J?) =
|
||||
if (a != null == true == false == false == false == true == false == true == false == false == true == true && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== nullableNothingProperty<!>) {
|
||||
if (a != null == true == false == false == false == true == false == true == false == false == true == true && a.x !== nullableNothingProperty) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J? & DeepObject.A.B.C.D.E.F.G.J")!>a<!>.x
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J? & DeepObject.A.B.C.D.E.F.G.J")!>a<!>.equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J? & DeepObject.A.B.C.D.E.F.G.J")!>a<!>.propT
|
||||
@@ -557,13 +557,13 @@ fun case_28(a: DeepObject.A.B.C.D.E.F.G.J?) =
|
||||
} else -1
|
||||
|
||||
// TESTCASE NUMBER: 29
|
||||
fun case_29(a: Int?, b: Nothing?, c: Int = if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a === b<!>) 0 else a) {
|
||||
fun case_29(a: Int?, b: Nothing?, c: Int = if (a === b) 0 else a) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>b<!>
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 30
|
||||
fun case_30(a: Int?, b: Nothing?, c: Int = if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a === b<!> || <!SENSELESS_COMPARISON!>a == null<!>) 0 else a) {
|
||||
fun case_30(a: Int?, b: Nothing?, c: Int = if (a === b || <!SENSELESS_COMPARISON!>a == null<!>) 0 else a) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>b<!>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user