[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
@@ -103,6 +103,7 @@ object FirEqualityCompatibilityChecker : FirEqualityOperatorCallChecker(MppCheck
val oneIsNotNull = !l.type.isNullable || !r.type.isNullable
return when {
l.type.isNullableNothing || r.type.isNullableNothing -> Applicability.APPLICABLE
l.isIdentityLess || r.isIdentityLess -> Applicability.INAPPLICABLE_AS_IDENTITY_LESS
oneIsNotNull && shouldReportAsPerRules1(l, r, context) -> getInapplicabilityFor(l, r)
else -> Applicability.APPLICABLE
@@ -55,7 +55,7 @@ fun test() {
x?.<!NONE_APPLICABLE!>equals<!>(1)
if (get() == null) {}
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>get() === null<!>) {}
if (get() === null) {}
if (x != null) {
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
@@ -114,7 +114,7 @@ fun test() {
emit(1)
emit(null)
val x = get()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
if (x === null) {
x.hashCode()
}
@@ -124,7 +124,7 @@ fun test() {
emit(1)
emit(null)
val x = get()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
if (x === null) {
x.equals("")
}
@@ -134,7 +134,7 @@ fun test() {
emit(1)
emit(null)
val x = get()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
if (x === null) {
x.<!NONE_APPLICABLE!>toString<!>("")
}
@@ -144,7 +144,7 @@ fun test() {
emit(1)
emit(null)
val x = get()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
if (x === null) {
x.test()
}
@@ -171,7 +171,7 @@ fun test() {
x?.<!NONE_APPLICABLE!>equals<!>(1)
if (get() == null) {}
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>get() === null<!>) {}
if (get() === null) {}
if (x == null) {
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
@@ -189,19 +189,19 @@ fun test() {
x.test2()
}
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
if (x === null) {
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
}
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
if (x === null) {
x<!UNNECESSARY_SAFE_CALL!>?.<!><!NONE_APPLICABLE!>equals<!>(1)
}
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
if (x === null) {
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!>test2()
}
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
if (x === null) {
x.test2()
}
@@ -248,7 +248,7 @@ fun test() {
emit(1)
emit(null)
val x = get()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
if (x === null) {
x.equals("")
}
@@ -258,7 +258,7 @@ fun test() {
emit(1)
emit(null)
val x = get()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
if (x === null) {
x.hashCode()
}
""
@@ -267,7 +267,7 @@ fun test() {
emit(1)
emit(null)
val x = get()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
if (x === null) {
x.toString()
}
""
@@ -276,7 +276,7 @@ fun test() {
emit(1)
emit(null)
val x = get()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
if (x === null) {
x.test()
}
""
@@ -301,7 +301,7 @@ fun test() {
x?.<!NONE_APPLICABLE!>equals<!>(1)
if (get() == null) {}
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>get() === null<!>) {}
if (get() === null) {}
if (x == null) {
<!BUILDER_INFERENCE_STUB_RECEIVER!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
@@ -87,7 +87,7 @@ fun incompatibleIdentityRegardlessNullabilitySmartCast(a: Any?, b: Any?) {
fun incompatibleIdentityRegardlessNullabilityWithNull(a: Int?) {
a == null
<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a === null<!>
a === null
}
fun incompatibleIdentityRegardlessNullabilityWithValueClasses(c: C?, d: D?) {
@@ -1,7 +1,7 @@
// LANGUAGE: +ReportErrorsForComparisonOperators
fun nullableNothingIdentity(a: Int, b: Nothing?) {
<!FORBIDDEN_IDENTITY_EQUALS, SENSELESS_COMPARISON!>a === b<!>
<!SENSELESS_COMPARISON!>a === b<!>
}
fun samePrimitiveIdentity(a: Int, b: Int) {
@@ -1,7 +1,7 @@
// LANGUAGE: -ReportErrorsForComparisonOperators
fun nullableNothingIdentity(a: Int, b: Nothing?) {
<!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>a === b<!>
<!SENSELESS_COMPARISON!>a === b<!>
}
fun samePrimitiveIdentity(a: Int, b: Int) {
@@ -29,7 +29,7 @@ fun case_1(x: Any?) {
// TESTCASE NUMBER: 3
fun case_3() {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>Object.prop_1 == null !== null<!>)
if (<!SENSELESS_COMPARISON!>Object.prop_1 == null !== null<!>)
else {
Object.prop_1
Object.prop_1<!UNSAFE_CALL!>.<!>equals(null)
@@ -112,13 +112,13 @@ fun case_7() {
// TESTCASE NUMBER: 8
fun case_8(x: TypealiasNullableString) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>x !== null === null<!> && <!SENSELESS_COMPARISON!><!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!> != null != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!><!UNSAFE_CALL!>.<!>get(0)
if (<!SENSELESS_COMPARISON!>x !== null != null<!> && <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!><!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!> != null === null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!><!UNSAFE_CALL!>.<!>get(0)
if (<!SENSELESS_COMPARISON!>x !== null === null<!> && <!SENSELESS_COMPARISON!><!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!> != null != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!><!UNSAFE_CALL!>.<!>get(0)
if (<!SENSELESS_COMPARISON!>x !== null != null<!> && <!SENSELESS_COMPARISON!><!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!> != null === null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!><!UNSAFE_CALL!>.<!>get(0)
}
// TESTCASE NUMBER: 9
fun case_9(x: TypealiasNullableString<!REDUNDANT_NULLABLE!>?<!>) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>x === null === null<!>) {
if (<!SENSELESS_COMPARISON!>x === null === null<!>) {
} else if (<!USELESS_IS_CHECK!>false is Boolean<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString?")!>x<!>
@@ -130,8 +130,8 @@ fun case_9(x: TypealiasNullableString<!REDUNDANT_NULLABLE!>?<!>) {
fun case_10() {
val a = Class()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.prop_4 === null<!> || <!USELESS_IS_CHECK!>true is Boolean<!>) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>a.prop_4 != null !== null<!>) {
if (a.prop_4 === null || <!USELESS_IS_CHECK!>true is Boolean<!>) {
if (<!SENSELESS_COMPARISON!>a.prop_4 != null !== null<!>) {
a.prop_4
a.prop_4<!UNSAFE_CALL!>.<!>equals(null)
a.prop_4.propT
@@ -175,7 +175,7 @@ fun case_11(x: TypealiasNullableStringIndirect<!REDUNDANT_NULLABLE!>?<!>, y: Typ
// TESTCASE NUMBER: 12
fun case_12(x: TypealiasNullableStringIndirect, y: TypealiasNullableStringIndirect) =
if (<!DEPRECATED_IDENTITY_EQUALS!><!USELESS_IS_CHECK!>(x == null) !is Boolean<!> === false<!>) "1"
else if (<!USELESS_IS_CHECK!>(<!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>y === null !== null<!>) is Boolean<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>
else if (<!USELESS_IS_CHECK!>(<!SENSELESS_COMPARISON!>y === null !== null<!>) is Boolean<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>
else if (<!SENSELESS_COMPARISON!>y === null != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>.equals(null)
else if (<!SENSELESS_COMPARISON!>y === null != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>.propT
else if (<!SENSELESS_COMPARISON!>y === null != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!><!UNSAFE_CALL!>.<!>propAny
@@ -212,7 +212,7 @@ fun case_14() {
if (a.x != null == true) {
if (<!SENSELESS_COMPARISON!>a.x !== null<!> == false) {
if (<!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>a.x != null<!> == null<!>) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>a.x != null<!> !== null<!>) {
if (<!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>a.x != null<!> !== null<!>) {
if (<!DEPRECATED_IDENTITY_EQUALS!><!SENSELESS_COMPARISON!>a.x != null<!> === true<!>) {
if (<!DEPRECATED_IDENTITY_EQUALS!><!SENSELESS_COMPARISON!>a.x !== null<!> === <!USELESS_IS_CHECK!>true !is Boolean<!><!> == true) {
if (<!DEPRECATED_IDENTITY_EQUALS!><!SENSELESS_COMPARISON!>a.x != null<!> !== false<!>) {
@@ -278,7 +278,7 @@ val case_17 = if (nullableIntProperty == null == true == false) 0 else {
//TESTCASE NUMBER: 18
fun case_18(a: DeepObject.A.B.C.D.E.F.G.J?) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>a != null !== null<!>) {
if (<!SENSELESS_COMPARISON!>a != null !== null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J?")!>a<!>
<!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J?")!>a<!><!UNSAFE_CALL!>.<!>equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J?")!>a<!>.propT
@@ -312,7 +312,7 @@ fun case_19(b: Boolean) {
}
} else null
if (<!EQUALITY_NOT_APPLICABLE!>a != null !is Boolean<!> && <!EQUALITY_NOT_APPLICABLE!>a<!UNSAFE_CALL!>.<!>B19 != null is Boolean<!> && <!EQUALITY_NOT_APPLICABLE!>a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19 != null is Boolean<!> && <!SENSELESS_COMPARISON!>a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19<!UNSAFE_CALL!>.<!>D19 != null == null<!> && <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19<!UNSAFE_CALL!>.<!>D19<!UNSAFE_CALL!>.<!>x != null !== null<!>) {
if (<!EQUALITY_NOT_APPLICABLE!>a != null !is Boolean<!> && <!EQUALITY_NOT_APPLICABLE!>a<!UNSAFE_CALL!>.<!>B19 != null is Boolean<!> && <!EQUALITY_NOT_APPLICABLE!>a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19 != null is Boolean<!> && <!SENSELESS_COMPARISON!>a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19<!UNSAFE_CALL!>.<!>D19 != null == null<!> && <!SENSELESS_COMPARISON!>a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19<!UNSAFE_CALL!>.<!>D19<!UNSAFE_CALL!>.<!>x != null !== null<!>) {
a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19<!UNSAFE_CALL!>.<!>D19<!UNSAFE_CALL!>.<!>x
a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19<!UNSAFE_CALL!>.<!>D19<!UNSAFE_CALL!>.<!>x<!UNSAFE_CALL!>.<!>equals(null)
a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19<!UNSAFE_CALL!>.<!>D19<!UNSAFE_CALL!>.<!>x.propT
@@ -30,7 +30,7 @@ fun case_1() {
*/
fun case_2() {
var x: Boolean? = true
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x !== null<!> && try { x = null; true } catch (e: Exception) { false }) {
if (x !== null && try { x = null; true } catch (e: Exception) { false }) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
}
@@ -172,7 +172,7 @@ fun case_9(x: TypealiasNullableString?) {
fun case_10() {
val a = Class()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.prop_4 === null<!> || true) {
if (a.prop_4 === null || true) {
if (a.prop_4 != null) {
a.prop_4
a.prop_4.equals(null)
@@ -418,7 +418,7 @@ fun case_20(b: Boolean) {
// TESTCASE NUMBER: 21
fun case_21() {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>EnumClassWithNullableProperty.B.prop_1 !== null<!>) {
if (EnumClassWithNullableProperty.B.prop_1 !== null) {
EnumClassWithNullableProperty.B.prop_1
EnumClassWithNullableProperty.B.prop_1.equals(null)
EnumClassWithNullableProperty.B.prop_1.propT
@@ -450,7 +450,7 @@ fun case_22(a: (() -> Unit)?) {
// TESTCASE NUMBER: 23
fun case_23(a: ((Float) -> Int?)?, b: Float?) {
if (a != null && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>b !== null<!>) {
if (a != null && b !== null) {
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>b<!>)<!>
if (x != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>
@@ -1534,36 +1534,36 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d:
}
fun case_29(a: Case29) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.equals(null)
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propNullableT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propNullableAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funNullableT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funNullableAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.equals(null)
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propNullableT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propNullableAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funNullableT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funNullableAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.equals(null)
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propNullableT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propNullableAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funNullableT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funNullableAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e
if (a.x !== null) a.x.equals(null)
if (a.x !== null) a.x.propT
if (a.x !== null) a.x.propAny
if (a.x !== null) a.x.propNullableT
if (a.x !== null) a.x.propNullableAny
if (a.x !== null) a.x.funT()
if (a.x !== null) a.x.funAny()
if (a.x !== null) a.x.funNullableT()
if (a.x !== null) a.x.funNullableAny()
if (a.x !== null) a.x
if (a.b !== null) a.b.equals(null)
if (a.b !== null) a.b.propT
if (a.b !== null) a.b.propAny
if (a.b !== null) a.b.propNullableT
if (a.b !== null) a.b.propNullableAny
if (a.b !== null) a.b.funT()
if (a.b !== null) a.b.funAny()
if (a.b !== null) a.b.funNullableT()
if (a.b !== null) a.b.funNullableAny()
if (a.b !== null) a.b
if (a.e !== null) a.e.equals(null)
if (a.e !== null) a.e.propT
if (a.e !== null) a.e.propAny
if (a.e !== null) a.e.propNullableT
if (a.e !== null) a.e.propNullableAny
if (a.e !== null) a.e.funT()
if (a.e !== null) a.e.funAny()
if (a.e !== null) a.e.funNullableT()
if (a.e !== null) a.e.funNullableAny()
if (a.e !== null) a.e
if (a.f !== null) a.f.equals(null)
if (a.f !== null) a.f.propT
if (a.f !== null) a.f.propAny
@@ -2578,36 +2578,36 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val
}
fun case_30(a: Case30) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.equals(null)
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propNullableT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propNullableAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funNullableT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funNullableAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.equals(null)
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propNullableT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propNullableAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funNullableT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funNullableAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.equals(null)
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propNullableT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propNullableAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funNullableT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funNullableAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e
if (a.x !== null) a.x.equals(null)
if (a.x !== null) a.x.propT
if (a.x !== null) a.x.propAny
if (a.x !== null) a.x.propNullableT
if (a.x !== null) a.x.propNullableAny
if (a.x !== null) a.x.funT()
if (a.x !== null) a.x.funAny()
if (a.x !== null) a.x.funNullableT()
if (a.x !== null) a.x.funNullableAny()
if (a.x !== null) a.x
if (a.b !== null) a.b.equals(null)
if (a.b !== null) a.b.propT
if (a.b !== null) a.b.propAny
if (a.b !== null) a.b.propNullableT
if (a.b !== null) a.b.propNullableAny
if (a.b !== null) a.b.funT()
if (a.b !== null) a.b.funAny()
if (a.b !== null) a.b.funNullableT()
if (a.b !== null) a.b.funNullableAny()
if (a.b !== null) a.b
if (a.e !== null) a.e.equals(null)
if (a.e !== null) a.e.propT
if (a.e !== null) a.e.propAny
if (a.e !== null) a.e.propNullableT
if (a.e !== null) a.e.propNullableAny
if (a.e !== null) a.e.funT()
if (a.e !== null) a.e.funAny()
if (a.e !== null) a.e.funNullableT()
if (a.e !== null) a.e.funNullableAny()
if (a.e !== null) a.e
if (a.f !== null) a.f.equals(null)
if (a.f !== null) a.f.propT
if (a.f !== null) a.f.propAny
@@ -3623,36 +3623,36 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d:
}
fun case_31(a: Case31) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.equals(null)
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propNullableT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propNullableAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funNullableT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funNullableAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.equals(null)
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propNullableT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propNullableAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funNullableT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funNullableAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.equals(null)
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propNullableT
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propNullableAny
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funNullableT()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funNullableAny()
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e
if (a.x !== null) a.x.equals(null)
if (a.x !== null) a.x.propT
if (a.x !== null) a.x.propAny
if (a.x !== null) a.x.propNullableT
if (a.x !== null) a.x.propNullableAny
if (a.x !== null) a.x.funT()
if (a.x !== null) a.x.funAny()
if (a.x !== null) a.x.funNullableT()
if (a.x !== null) a.x.funNullableAny()
if (a.x !== null) a.x
if (a.b !== null) a.b.equals(null)
if (a.b !== null) a.b.propT
if (a.b !== null) a.b.propAny
if (a.b !== null) a.b.propNullableT
if (a.b !== null) a.b.propNullableAny
if (a.b !== null) a.b.funT()
if (a.b !== null) a.b.funAny()
if (a.b !== null) a.b.funNullableT()
if (a.b !== null) a.b.funNullableAny()
if (a.b !== null) a.b
if (a.e !== null) a.e.equals(null)
if (a.e !== null) a.e.propT
if (a.e !== null) a.e.propAny
if (a.e !== null) a.e.propNullableT
if (a.e !== null) a.e.propNullableAny
if (a.e !== null) a.e.funT()
if (a.e !== null) a.e.funAny()
if (a.e !== null) a.e.funNullableT()
if (a.e !== null) a.e.funNullableAny()
if (a.e !== null) a.e
if (a.f !== null) a.f.equals(null)
if (a.f !== null) a.f.propT
if (a.f !== null) a.f.propAny
@@ -123,7 +123,7 @@ fun case_9(x: String?) {
// TESTCASE NUMBER: 10
fun case_10(x: Float?) {
if (true && true && true && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x !== null<!>) else return
if (true && true && true && x !== null) else return
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.propT
@@ -474,7 +474,7 @@ fun case_33(x: Any?) {
// TESTCASE NUMBER: 34
fun case_34(x: Float?) {
(l@ {
if (true && true && true && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x !== null<!>) else return@l
if (true && true && true && x !== null) else return@l
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.propT
@@ -486,7 +486,7 @@ fun case_34(x: Float?) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.funNullableAny()
}).equals(l@ {
if (true && true && true && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x !== null<!>) else return@l
if (true && true && true && x !== null) else return@l
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.propT
@@ -122,7 +122,7 @@ fun case_9(x: String?) {
// TESTCASE NUMBER: 10
fun case_10(x: Float?) {
if (true && true && true && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x !== null<!>) else throw Exception()
if (true && true && true && x !== null) else throw Exception()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.propT
@@ -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<!>
@@ -68,7 +68,7 @@ fun case_7(x: DeepObject.A.B.C.D.E.F.G.J?) {
// TESTCASE NUMBER: 8
fun case_8(x: Any?) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) === null<!>) else {
if (x?.equals(10) === null) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
}
@@ -76,7 +76,7 @@ fun case_8(x: Any?) {
// TESTCASE NUMBER: 9
fun case_9(x: Any?) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) !== null<!>) {
if (x?.equals(10) !== null) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
}
@@ -126,7 +126,7 @@ inline fun <reified T>case_13(x: Any?) {
// TESTCASE NUMBER: 14
inline fun <reified T>case_14(x: Any?) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) === null<!>) else {
if (x?.equals(10) === null) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
}
@@ -134,7 +134,7 @@ inline fun <reified T>case_14(x: Any?) {
// TESTCASE NUMBER: 15
inline fun <reified T>case_15(x: Any?) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) !== null<!>) {
if (x?.equals(10) !== null) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
}
@@ -146,7 +146,7 @@ inline fun <reified T>case_15(x: Any?) {
* ISSUES: KT-30369, KT-28262
*/
inline fun <reified T>case_16(x: Any?) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) === null<!> == true) else {
if (x?.equals(10) === null == true) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
}
@@ -158,7 +158,7 @@ inline fun <reified T>case_16(x: Any?) {
* ISSUES: KT-30369, KT-28262
*/
inline fun <reified T>case_17(x: Any?) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) !== null<!> == true) {
if (x?.equals(10) !== null == true) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
}
@@ -170,7 +170,7 @@ inline fun <reified T>case_17(x: Any?) {
* ISSUES: KT-30369, KT-28262, KT-29878
*/
inline fun <reified T>case_18(x: Any?) {
if (<!DEPRECATED_IDENTITY_EQUALS!><!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) === null<!> === true<!>) else {
if (<!DEPRECATED_IDENTITY_EQUALS!>x?.equals(10) === null === true<!>) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
}
@@ -182,7 +182,7 @@ inline fun <reified T>case_18(x: Any?) {
* ISSUES: KT-30369, KT-28262, KT-29878
*/
inline fun <reified T>case_19(x: Any?) {
if (<!DEPRECATED_IDENTITY_EQUALS!><!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) !== null<!> === true<!>) {
if (<!DEPRECATED_IDENTITY_EQUALS!>x?.equals(10) !== null === true<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
}
@@ -194,7 +194,7 @@ inline fun <reified T>case_19(x: Any?) {
* ISSUES: KT-30369, KT-28262, KT-29878
*/
inline fun <reified T>case_20(x: Any?) {
if (<!DEPRECATED_IDENTITY_EQUALS!><!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) === null<!> !== false<!>) else {
if (<!DEPRECATED_IDENTITY_EQUALS!>x?.equals(10) === null !== false<!>) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
}
@@ -206,7 +206,7 @@ inline fun <reified T>case_20(x: Any?) {
* ISSUES: KT-30369, KT-28262, KT-29878
*/
inline fun <reified T>case_21(x: Any?) {
if (<!DEPRECATED_IDENTITY_EQUALS!><!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) !== null<!> !== false<!>) {
if (<!DEPRECATED_IDENTITY_EQUALS!>x?.equals(10) !== null !== false<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
}
@@ -218,7 +218,7 @@ inline fun <reified T>case_21(x: Any?) {
* ISSUES: KT-30369, KT-28262, KT-29878
*/
inline fun <reified T>case_22(x: Any?) {
if (<!DEPRECATED_IDENTITY_EQUALS!><!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) !== null<!> !== true<!>) else {
if (<!DEPRECATED_IDENTITY_EQUALS!>x?.equals(10) !== null !== true<!>) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
}
@@ -230,7 +230,7 @@ inline fun <reified T>case_22(x: Any?) {
* ISSUES: KT-30369, KT-28262, KT-29878
*/
inline fun <reified T>case_23(x: Any?) {
if (<!DEPRECATED_IDENTITY_EQUALS!><!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) === null<!> === false<!>) {
if (<!DEPRECATED_IDENTITY_EQUALS!>x?.equals(10) === null === false<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
}
@@ -242,7 +242,7 @@ inline fun <reified T>case_23(x: Any?) {
* ISSUES: KT-30369, KT-28262
*/
inline fun <reified T>case_24(x: Any?) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) !== null<!> != true) else {
if (x?.equals(10) !== null != true) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
}
@@ -254,7 +254,7 @@ inline fun <reified T>case_24(x: Any?) {
* ISSUES: KT-30369, KT-28262
*/
inline fun <reified T>case_25(x: Any?) {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) === null<!> == false) {
if (x?.equals(10) === null == false) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
}
@@ -195,7 +195,7 @@ fun case_16() {
}
// TESTCASE NUMBER: 17
val case_17 = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>nullableIntProperty !== null<!>) 0 else {
val case_17 = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>if (nullableIntProperty !== null) 0 else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>nullableIntProperty<!>
}<!>
@@ -305,7 +305,7 @@ fun case_25(b: Boolean) {
}
// TESTCASE NUMBER: 26
fun case_26(a: Int?, b: Int? = if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a !== null<!>) 0 else <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>a<!>) {
fun case_26(a: Int?, b: Int? = if (a !== null) 0 else <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>a<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>b<!>
}
@@ -265,7 +265,7 @@ fun case_22(a: (() -> Unit)) {
fun case_23(a: ((Float) -> Int), b: Float) {
if (<!SENSELESS_COMPARISON!>a == null<!> && <!SENSELESS_COMPARISON!>b == null<!>) {
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>a(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float & kotlin.Nothing")!>b<!>)<!>
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>x !== null<!>) {
if (<!SENSELESS_COMPARISON!>x !== null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>x<!>
}
}
@@ -290,7 +290,7 @@ fun case_25(a: (() -> Unit) -> Unit, b: (() -> Unit) -> Unit = if (<!SENSELESS_C
}
// TESTCASE NUMBER: 26
fun case_26(a: Int, b: Int = if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>a === null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Nothing")!>a<!> else 0) {
fun case_26(a: Int, b: Int = if (<!SENSELESS_COMPARISON!>a === null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Nothing")!>a<!> else 0) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>a<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>
}
@@ -360,7 +360,7 @@ fun case_15(x: Any?) {
}
// TESTCASE NUMBER: 16
fun case_16(a: Any?, b: Int = if (a is Number? && a is Int? && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a !== null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Int")!>a<!> else 0) {
fun case_16(a: Any?, b: Int = if (a is Number? && a is Int? && a !== null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Int")!>a<!> else 0) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>a<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>.equals(null)
@@ -35,7 +35,7 @@ fun case_2() {
do {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
x = x<!UNSAFE_CALL!>.<!>equals(10)
} while (<!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>x !== null<!>)
} while (<!SENSELESS_COMPARISON!>x !== null<!>)
}
// TESTCASE NUMBER: 3
@@ -67,7 +67,7 @@ fun case_5() {
do {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
x = x<!UNSAFE_CALL!>.<!>equals(10)
} while (<!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>x !== null<!>)
} while (<!SENSELESS_COMPARISON!>x !== null<!>)
}
/*
@@ -95,7 +95,7 @@ fun case_7() {
do {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
x = x<!UNSAFE_CALL!>.<!>equals(10)
} while (<!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>x !== null<!>)
} while (<!SENSELESS_COMPARISON!>x !== null<!>)
}
/*
@@ -123,7 +123,7 @@ fun case_9() {
do {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
x = x<!UNSAFE_CALL!>.<!>equals(10)
} while (<!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>x !== null<!>)
} while (<!SENSELESS_COMPARISON!>x !== null<!>)
}
/*
@@ -183,7 +183,7 @@ fun case_10() {
val a = Class()
val b = null
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.prop_4 === b<!> || true) {
if (a.prop_4 === b || true) {
if (a.prop_4 != null) {
a.prop_4
a.prop_4.equals(null)
@@ -315,7 +315,7 @@ fun case_16() {
}
// TESTCASE NUMBER: 17
val case_17 = if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>nullableIntProperty === implicitNullableNothingProperty<!>) 0 else {
val case_17 = if (nullableIntProperty === implicitNullableNothingProperty) 0 else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>nullableIntProperty<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>nullableIntProperty<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>nullableIntProperty<!>.propT
@@ -413,7 +413,7 @@ fun case_20(x: Boolean, y: Nothing?) {
// TESTCASE NUMBER: 21
fun case_21() {
if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>EnumClassWithNullableProperty.A.prop_1 !== implicitNullableNothingProperty<!>) {
if (EnumClassWithNullableProperty.A.prop_1 !== implicitNullableNothingProperty) {
EnumClassWithNullableProperty.A.prop_1
EnumClassWithNullableProperty.A.prop_1.equals(null)
EnumClassWithNullableProperty.A.prop_1.propT
@@ -445,9 +445,9 @@ fun case_22(a: (() -> Unit)?) {
// TESTCASE NUMBER: 23
fun case_23(a: ((Float) -> Int?)?, b: Float?, z: Nothing?) {
if (a != z && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>b !== z<!> && <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>b !== z<!>) {
if (a != z && b !== z && <!SENSELESS_COMPARISON!>b !== z<!>) {
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>b<!>)<!>
if (x != z || <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>x !== implicitNullableNothingProperty<!>) {
if (x != z || <!SENSELESS_COMPARISON!>x !== implicitNullableNothingProperty<!>) {
<!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
@@ -520,7 +520,7 @@ fun case_26(a: ((Float) -> Int?)?, b: Float?) {
if (a != z == true && b != implicitNullableNothingProperty == true) {
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>b<!>)<!>
if (x != implicitNullableNothingProperty == true || <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>z !== x<!>) {
if (x != implicitNullableNothingProperty == true || <!SENSELESS_COMPARISON!>z !== 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
@@ -621,7 +621,7 @@ fun case_30(a: ((Float) -> Int?)?, b: Float?) {
// TESTCASE NUMBER: 31
fun case_31(z1: Boolean?, z: Nothing?) {
if (false || EnumClassWithNullableProperty.A.prop_1 != z && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>z1 !== z<!> && z1) {
if (false || EnumClassWithNullableProperty.A.prop_1 != z && z1 !== z && z1) {
EnumClassWithNullableProperty.A.prop_1
EnumClassWithNullableProperty.A.prop_1<!UNSAFE_CALL!>.<!>equals(null)
EnumClassWithNullableProperty.A.prop_1.propT
@@ -660,7 +660,7 @@ fun case_33(a: ((Float) -> Int?)?, b: Float?, c: Boolean?) {
} else {
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!><!UNSAFE_IMPLICIT_INVOKE_CALL!>a<!>(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>b<!>)<!>
if (x == z == true && <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>x === z<!> || (c != z && !c)) {
if (x == z == true && <!SENSELESS_COMPARISON!>x === z<!> || (c != z && !c)) {
} else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>
@@ -685,7 +685,7 @@ fun case_33(a: ((Float) -> Int?)?, b: Float?, c: Boolean?) {
fun case_34(z1: Boolean?) {
<!CAN_BE_VAL!>var<!> z = null
if (true && true && true && true && EnumClassWithNullableProperty.A.prop_1 != implicitNullableNothingProperty && <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>EnumClassWithNullableProperty.A.prop_1 !== null<!> && <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>EnumClassWithNullableProperty.A.prop_1 !== z<!> || z1 != implicitNullableNothingProperty || z1!! && true && true) {
if (true && true && true && true && EnumClassWithNullableProperty.A.prop_1 != implicitNullableNothingProperty && <!SENSELESS_COMPARISON!>EnumClassWithNullableProperty.A.prop_1 !== null<!> && <!SENSELESS_COMPARISON!>EnumClassWithNullableProperty.A.prop_1 !== z<!> || z1 != implicitNullableNothingProperty || z1!! && true && true) {
} else {
EnumClassWithNullableProperty.A.prop_1
@@ -925,7 +925,7 @@ fun case_51() {
}
// TESTCASE NUMBER: 52
val case_52 = if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>nullableIntProperty !== nullableNothingProperty<!> && <!SENSELESS_COMPARISON!>nullableNothingProperty != nullableIntProperty<!>) 0 else {
val case_52 = if (nullableIntProperty !== nullableNothingProperty && <!SENSELESS_COMPARISON!>nullableNothingProperty != nullableIntProperty<!>) 0 else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>nullableIntProperty<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>nullableIntProperty<!>.hashCode()
}
@@ -1011,7 +1011,7 @@ fun case_57(a: (() -> Unit)) {
* UNEXPECTED BEHAVIOUR
*/
fun case_58(a: ((Float) -> Int?)?, b: Float?, z: Nothing?) {
if (a === z && b == z || z == a && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>z === b<!>) {
if (a === z && b == z || z == a && z === b) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Float, kotlin.Int?>?")!>a<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float?")!>b<!>
if (a != z) {
@@ -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<!>
}