[FIR] Ignore nullability in the definition of "identity-less"

The definition of a "builtin" already
ignores nullability.

`Int? === String?` must trigger a
diagnostic by design.
This commit is contained in:
Nikolay Lunyak
2023-04-19 10:27:17 +03:00
committed by Space Team
parent 5ecedcbb16
commit 8d04ab3142
19 changed files with 179 additions and 176 deletions
@@ -123,7 +123,7 @@ fun test_10(a: Int?, b: Int?) {
} }
b<!UNSAFE_CALL!>.<!>inc() b<!UNSAFE_CALL!>.<!>inc()
if (a === b) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a === b<!>) {
b<!UNSAFE_CALL!>.<!>inc() b<!UNSAFE_CALL!>.<!>inc()
} }
b<!UNSAFE_CALL!>.<!>inc() b<!UNSAFE_CALL!>.<!>inc()
@@ -133,7 +133,7 @@ fun test_10(a: Int?, b: Int?) {
} }
b<!UNSAFE_CALL!>.<!>inc() b<!UNSAFE_CALL!>.<!>inc()
if (b === a) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>b === a<!>) {
b<!UNSAFE_CALL!>.<!>inc() b<!UNSAFE_CALL!>.<!>inc()
} }
b<!UNSAFE_CALL!>.<!>inc() b<!UNSAFE_CALL!>.<!>inc()
@@ -121,15 +121,15 @@ object FirEqualityCompatibilityChecker : FirEqualityOperatorCallChecker() {
// we only need to check if one is related // we only need to check if one is related
// to the other // to the other
fun TypeInfo.isSubtypeOf(other: TypeInfo) =
notNullType.isSubtypeOf(other.notNullType, context.session)
return when { return when {
l.type.isNothingOrNullableNothing || r.type.isNothingOrNullableNothing -> false l.type.isNothingOrNullableNothing || r.type.isNothingOrNullableNothing -> false
else -> !l.isSubtypeOf(r) && !r.isSubtypeOf(l) else -> !l.isSubtypeOf(r, context) && !r.isSubtypeOf(l, context)
} }
} }
private fun TypeInfo.isSubtypeOf(other: TypeInfo, context: CheckerContext) =
notNullType.isSubtypeOf(other.notNullType, context.session)
private enum class Applicability { private enum class Applicability {
APPLICABLE, APPLICABLE,
GENERALLY_INAPPLICABLE, GENERALLY_INAPPLICABLE,
@@ -153,12 +153,13 @@ object FirEqualityCompatibilityChecker : FirEqualityOperatorCallChecker() {
forceWarning: Boolean, forceWarning: Boolean,
context: CheckerContext, context: CheckerContext,
): KtDiagnosticFactory2<ConeKotlinType, ConeKotlinType> { ): KtDiagnosticFactory2<ConeKotlinType, ConeKotlinType> {
val areBothPrimitives = l.isPrimitive && r.isPrimitive val areBothPrimitives = l.isNotNullPrimitive && r.isNotNullPrimitive
val areSameTypes = l.type.classId == r.type.classId val areSameTypes = l.type.classId == r.type.classId
val shouldProperlyReportError = context.languageVersionSettings.supportsFeature(LanguageFeature.ReportErrorsForComparisonOperators) val shouldProperlyReportError = context.languageVersionSettings.supportsFeature(LanguageFeature.ReportErrorsForComparisonOperators)
// In this case K1 reports nothing // In this case K1 reports nothing
val shouldRelaxDiagnostic = (l.type.isNullableNothing || r.type.isNullableNothing) && !shouldProperlyReportError val shouldRelaxDiagnostic = (l.isPrimitive || r.isPrimitive) && (l.isSubtypeOf(r, context) || r.isSubtypeOf(l, context))
&& !shouldProperlyReportError
return when { return when {
// See: KT-28252 // See: KT-28252
@@ -174,7 +175,7 @@ object FirEqualityCompatibilityChecker : FirEqualityOperatorCallChecker() {
isPrimitiveWithNonPrimitiveSupertype(l, r, session) || isPrimitiveWithNonPrimitiveSupertype(r, l, session) isPrimitiveWithNonPrimitiveSupertype(l, r, session) || isPrimitiveWithNonPrimitiveSupertype(r, l, session)
private fun isPrimitiveWithNonPrimitiveSupertype(l: TypeInfo, r: TypeInfo, session: FirSession) = private fun isPrimitiveWithNonPrimitiveSupertype(l: TypeInfo, r: TypeInfo, session: FirSession) =
l.isPrimitive && !r.isPrimitive && l.type.isSubtypeOf(r.type, session) l.isNotNullPrimitive && !r.isNotNullPrimitive && l.type.isSubtypeOf(r.type, session)
private fun getSourceLessInapplicabilityDiagnostic(forceWarning: Boolean) = when { private fun getSourceLessInapplicabilityDiagnostic(forceWarning: Boolean) = when {
forceWarning -> FirErrors.INCOMPATIBLE_TYPES_WARNING forceWarning -> FirErrors.INCOMPATIBLE_TYPES_WARNING
@@ -298,7 +299,9 @@ private val TypeInfo.enforcesEmptyIntersection get() = isFinalClass && !isEnumCl
private val TypeInfo.isNullableEnum get() = isEnumClass && type.isNullable private val TypeInfo.isNullableEnum get() = isEnumClass && type.isNullable
private val TypeInfo.isIdentityLess get() = isPrimitive || !type.isNullable && isValueClass private val TypeInfo.isIdentityLess get() = isPrimitive || isValueClass
private val TypeInfo.isNotNullPrimitive get() = isPrimitive && !type.isNullable
private val FirClassSymbol<*>.isFinalClass get() = isClass && isFinal private val FirClassSymbol<*>.isFinalClass get() = isClass && isFinal
@@ -315,7 +318,7 @@ private fun ConeKotlinType.toTypeInfo(session: FirSession): TypeInfo {
type, notNullType, type, notNullType,
isFinalClass = bounds.any { it.toClassSymbol(session)?.isFinalClass == true }, isFinalClass = bounds.any { it.toClassSymbol(session)?.isFinalClass == true },
isEnumClass = bounds.any { it.toClassSymbol(session)?.isEnumClass == true }, isEnumClass = bounds.any { it.toClassSymbol(session)?.isEnumClass == true },
isPrimitive = bounds.any { it.isPrimitive }, isPrimitive = bounds.any { it.isPrimitiveOrNullablePrimitive },
isBuiltin = bounds.any { it.toClassSymbol(session)?.isBuiltin == true }, isBuiltin = bounds.any { it.toClassSymbol(session)?.isBuiltin == true },
isValueClass = bounds.any { it.toClassSymbol(session)?.isInline == true }, isValueClass = bounds.any { it.toClassSymbol(session)?.isInline == true },
isLiterallyTypeParameter = this.lowerBoundIfFlexible() is ConeTypeParameterType, isLiterallyTypeParameter = this.lowerBoundIfFlexible() is ConeTypeParameterType,
@@ -15,8 +15,8 @@ fun f(): Unit {
<!EQUALITY_NOT_APPLICABLE!>A() == 1<!> <!EQUALITY_NOT_APPLICABLE!>A() == 1<!>
<!EQUALITY_NOT_APPLICABLE!>x === "1"<!> <!FORBIDDEN_IDENTITY_EQUALS!>x === "1"<!>
<!EQUALITY_NOT_APPLICABLE!>x !== "1"<!> <!FORBIDDEN_IDENTITY_EQUALS!>x !== "1"<!>
<!IMPLICIT_BOXING_IN_IDENTITY_EQUALS!>x === 1<!> <!IMPLICIT_BOXING_IN_IDENTITY_EQUALS!>x === 1<!>
<!IMPLICIT_BOXING_IN_IDENTITY_EQUALS!>x !== 1<!> <!IMPLICIT_BOXING_IN_IDENTITY_EQUALS!>x !== 1<!>
@@ -54,7 +54,7 @@ fun test() {
x?.<!NONE_APPLICABLE!>equals<!>(1) x?.<!NONE_APPLICABLE!>equals<!>(1)
if (get() == null) {} if (get() == null) {}
if (get() === null) {} if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>get() === null<!>) {}
if (x != null) { if (x != null) {
x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode() x<!UNNECESSARY_SAFE_CALL!>?.<!>hashCode()
@@ -113,7 +113,7 @@ fun test() {
emit(1) emit(1)
emit(null) emit(null)
val x = get() val x = get()
if (x === null) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
x.hashCode() x.hashCode()
} }
@@ -123,7 +123,7 @@ fun test() {
emit(1) emit(1)
emit(null) emit(null)
val x = get() val x = get()
if (x === null) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
x.equals("") x.equals("")
} }
@@ -133,7 +133,7 @@ fun test() {
emit(1) emit(1)
emit(null) emit(null)
val x = get() val x = get()
if (x === null) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
x<!UNSAFE_CALL!>.<!>toString("") x<!UNSAFE_CALL!>.<!>toString("")
} }
@@ -143,7 +143,7 @@ fun test() {
emit(1) emit(1)
emit(null) emit(null)
val x = get() val x = get()
if (x === null) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
x<!UNSAFE_CALL!>.<!>test() x<!UNSAFE_CALL!>.<!>test()
} }
@@ -170,7 +170,7 @@ fun test() {
x?.<!NONE_APPLICABLE!>equals<!>(1) x?.<!NONE_APPLICABLE!>equals<!>(1)
if (get() == null) {} if (get() == null) {}
if (get() === null) {} if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>get() === null<!>) {}
if (x == null) { if (x == null) {
x?.hashCode() x?.hashCode()
@@ -188,19 +188,19 @@ fun test() {
x.test2() x.test2()
} }
if (x === null) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
x?.hashCode() x?.hashCode()
} }
if (x === null) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
x?.<!NONE_APPLICABLE!>equals<!>(1) x?.<!NONE_APPLICABLE!>equals<!>(1)
} }
if (x === null) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
x?.test2() x?.test2()
} }
if (x === null) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
x.test2() x.test2()
} }
@@ -247,7 +247,7 @@ fun test() {
emit(1) emit(1)
emit(null) emit(null)
val x = get() val x = get()
if (x === null) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
x.equals("") x.equals("")
} }
@@ -257,7 +257,7 @@ fun test() {
emit(1) emit(1)
emit(null) emit(null)
val x = get() val x = get()
if (x === null) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
x.hashCode() x.hashCode()
} }
"" ""
@@ -266,7 +266,7 @@ fun test() {
emit(1) emit(1)
emit(null) emit(null)
val x = get() val x = get()
if (x === null) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
x.toString() x.toString()
} }
"" ""
@@ -275,7 +275,7 @@ fun test() {
emit(1) emit(1)
emit(null) emit(null)
val x = get() val x = get()
if (x === null) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === null<!>) {
x<!UNSAFE_CALL!>.<!>test() x<!UNSAFE_CALL!>.<!>test()
} }
"" ""
@@ -300,7 +300,7 @@ fun test() {
x?.<!NONE_APPLICABLE!>equals<!>(1) x?.<!NONE_APPLICABLE!>equals<!>(1)
if (get() == null) {} if (get() == null) {}
if (get() === null) {} if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>get() === null<!>) {}
if (x == null) { if (x == null) {
x?.hashCode() x?.hashCode()
@@ -9,7 +9,7 @@ fun test(f1: Foo, f2: Foo, b1: Bar, fn1: Foo?, fn2: Foo?) {
val a2 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === f1<!> val a2 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === f1<!>
val a3 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === b1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>f1 !== b1<!> val a3 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === b1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>f1 !== b1<!>
val c1 = fn1 === fn2 || fn1 !== fn2 val c1 = <!FORBIDDEN_IDENTITY_EQUALS!>fn1 === fn2<!> || <!FORBIDDEN_IDENTITY_EQUALS!>fn1 !== fn2<!>
val c2 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === fn1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>f1 !== fn1<!> val c2 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === fn1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>f1 !== fn1<!>
val c3 = <!FORBIDDEN_IDENTITY_EQUALS!>b1 === fn1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>b1 !== fn1<!> val c3 = <!FORBIDDEN_IDENTITY_EQUALS!>b1 === fn1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>b1 !== fn1<!>
@@ -17,6 +17,6 @@ fun test(f1: Foo, f2: Foo, b1: Bar, fn1: Foo?, fn2: Foo?) {
val d1 = <!FORBIDDEN_IDENTITY_EQUALS!>any === f1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>any !== f1<!> val d1 = <!FORBIDDEN_IDENTITY_EQUALS!>any === f1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>any !== f1<!>
val d2 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === any<!> || <!FORBIDDEN_IDENTITY_EQUALS!>f1 !== any<!> val d2 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === any<!> || <!FORBIDDEN_IDENTITY_EQUALS!>f1 !== any<!>
val d3 = any === fn1 || any !== fn1 val d3 = <!FORBIDDEN_IDENTITY_EQUALS!>any === fn1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>any !== fn1<!>
val d4 = fn1 === any || fn1 !== any val d4 = <!FORBIDDEN_IDENTITY_EQUALS!>fn1 === any<!> || <!FORBIDDEN_IDENTITY_EQUALS!>fn1 !== any<!>
} }
@@ -17,7 +17,7 @@ fun test(f1: Foo, f2: Foo, b1: Bar, fn1: Foo?, fn2: Foo?) {
val a2 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === f1<!> val a2 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === f1<!>
val a3 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === b1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>f1 !== b1<!> val a3 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === b1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>f1 !== b1<!>
val c1 = fn1 === fn2 || fn1 !== fn2 val c1 = <!FORBIDDEN_IDENTITY_EQUALS!>fn1 === fn2<!> || <!FORBIDDEN_IDENTITY_EQUALS!>fn1 !== fn2<!>
val c2 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === fn1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>f1 !== fn1<!> val c2 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === fn1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>f1 !== fn1<!>
val c3 = <!FORBIDDEN_IDENTITY_EQUALS!>b1 === fn1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>b1 !== fn1<!> val c3 = <!FORBIDDEN_IDENTITY_EQUALS!>b1 === fn1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>b1 !== fn1<!>
@@ -25,6 +25,6 @@ fun test(f1: Foo, f2: Foo, b1: Bar, fn1: Foo?, fn2: Foo?) {
val d1 = <!FORBIDDEN_IDENTITY_EQUALS!>any === f1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>any !== f1<!> val d1 = <!FORBIDDEN_IDENTITY_EQUALS!>any === f1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>any !== f1<!>
val d2 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === any<!> || <!FORBIDDEN_IDENTITY_EQUALS!>f1 !== any<!> val d2 = <!FORBIDDEN_IDENTITY_EQUALS!>f1 === any<!> || <!FORBIDDEN_IDENTITY_EQUALS!>f1 !== any<!>
val d3 = any === fn1 || any !== fn1 val d3 = <!FORBIDDEN_IDENTITY_EQUALS!>any === fn1<!> || <!FORBIDDEN_IDENTITY_EQUALS!>any !== fn1<!>
val d4 = fn1 === any || fn1 !== any val d4 = <!FORBIDDEN_IDENTITY_EQUALS!>fn1 === any<!> || <!FORBIDDEN_IDENTITY_EQUALS!>fn1 !== any<!>
} }
@@ -75,24 +75,24 @@ fun incompatibleEnumComparisonSmartCast(c: Any?, e: Any?) {
fun incompatibleIdentityRegardlessNullability(a: Int?, b: String?) { fun incompatibleIdentityRegardlessNullability(a: Int?, b: String?) {
<!EQUALITY_NOT_APPLICABLE!>a == b<!> <!EQUALITY_NOT_APPLICABLE!>a == b<!>
a === b <!FORBIDDEN_IDENTITY_EQUALS!>a === b<!>
} }
fun incompatibleIdentityRegardlessNullabilitySmartCast(a: Any?, b: Any?) { fun incompatibleIdentityRegardlessNullabilitySmartCast(a: Any?, b: Any?) {
if (a is Int? && b is String?) { if (a is Int? && b is String?) {
<!EQUALITY_NOT_APPLICABLE_WARNING!>a == b<!> <!EQUALITY_NOT_APPLICABLE_WARNING!>a == b<!>
a === b <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a === b<!>
} }
} }
fun incompatibleIdentityRegardlessNullabilityWithValueClasses(c: C?, d: D?) { fun incompatibleIdentityRegardlessNullabilityWithValueClasses(c: C?, d: D?) {
c == d c == d
c === d <!FORBIDDEN_IDENTITY_EQUALS!>c === d<!>
} }
fun incompatibleIdentityRegardlessNullabilityWithValueClassesSmartCast(c: Any?, d: Any?) { fun incompatibleIdentityRegardlessNullabilityWithValueClassesSmartCast(c: Any?, d: Any?) {
if (c is C? && d is D?) { if (c is C? && d is D?) {
c == d c == d
c === d <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>c === d<!>
} }
} }
@@ -122,7 +122,7 @@ fun case_9(x: TypealiasNullableString<!REDUNDANT_NULLABLE!>?<!>) {
fun case_10() { fun case_10() {
val a = Class() val a = Class()
if (a.prop_4 === null || <!USELESS_IS_CHECK!>true is Boolean<!>) { 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 (<!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>a.prop_4 != null !== null<!>) {
a.prop_4 a.prop_4
a.prop_4<!UNSAFE_CALL!>.<!>equals(null) a.prop_4<!UNSAFE_CALL!>.<!>equals(null)
@@ -21,7 +21,7 @@ fun case_1() {
*/ */
fun case_2() { fun case_2() {
var x: Boolean? = true var x: Boolean? = true
if (x !== null && try { x = null; true } catch (e: Exception) { false }) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x !== null<!> && try { x = null; true } catch (e: Exception) { false }) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not() <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
} }
@@ -173,7 +173,7 @@ fun case_9(x: TypealiasNullableString?) {
fun case_10() { fun case_10() {
val a = Class() val a = Class()
if (a.prop_4 === null || true) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.prop_4 === null<!> || true) {
if (a.prop_4 != null) { if (a.prop_4 != null) {
a.prop_4 a.prop_4
a.prop_4.equals(null) a.prop_4.equals(null)
@@ -419,7 +419,7 @@ fun case_20(b: Boolean) {
// TESTCASE NUMBER: 21 // TESTCASE NUMBER: 21
fun case_21() { fun case_21() {
if (EnumClassWithNullableProperty.B.prop_1 !== null) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>EnumClassWithNullableProperty.B.prop_1 !== null<!>) {
EnumClassWithNullableProperty.B.prop_1 EnumClassWithNullableProperty.B.prop_1
EnumClassWithNullableProperty.B.prop_1.equals(null) EnumClassWithNullableProperty.B.prop_1.equals(null)
EnumClassWithNullableProperty.B.prop_1.propT EnumClassWithNullableProperty.B.prop_1.propT
@@ -451,7 +451,7 @@ fun case_22(a: (() -> Unit)?) {
// TESTCASE NUMBER: 23 // TESTCASE NUMBER: 23
fun case_23(a: ((Float) -> Int?)?, b: Float?) { fun case_23(a: ((Float) -> Int?)?, b: Float?) {
if (a != null && b !== null) { if (a != null && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>b !== null<!>) {
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>b<!>)<!> val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>b<!>)<!>
if (x != null) { if (x != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>
@@ -1535,36 +1535,36 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d:
} }
fun case_29(a: Case29) { fun case_29(a: Case29) {
if (a.x !== null) a.x.equals(null) if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.equals(null)
if (a.x !== null) a.x.propT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propT
if (a.x !== null) a.x.propAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propAny
if (a.x !== null) a.x.propNullableT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propNullableT
if (a.x !== null) a.x.propNullableAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propNullableAny
if (a.x !== null) a.x.funT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funT()
if (a.x !== null) a.x.funAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funAny()
if (a.x !== null) a.x.funNullableT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funNullableT()
if (a.x !== null) a.x.funNullableAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funNullableAny()
if (a.x !== null) a.x if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x
if (a.b !== null) a.b.equals(null) if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.equals(null)
if (a.b !== null) a.b.propT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propT
if (a.b !== null) a.b.propAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propAny
if (a.b !== null) a.b.propNullableT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propNullableT
if (a.b !== null) a.b.propNullableAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propNullableAny
if (a.b !== null) a.b.funT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funT()
if (a.b !== null) a.b.funAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funAny()
if (a.b !== null) a.b.funNullableT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funNullableT()
if (a.b !== null) a.b.funNullableAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funNullableAny()
if (a.b !== null) a.b if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b
if (a.e !== null) a.e.equals(null) if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.equals(null)
if (a.e !== null) a.e.propT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propT
if (a.e !== null) a.e.propAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propAny
if (a.e !== null) a.e.propNullableT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propNullableT
if (a.e !== null) a.e.propNullableAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propNullableAny
if (a.e !== null) a.e.funT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funT()
if (a.e !== null) a.e.funAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funAny()
if (a.e !== null) a.e.funNullableT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funNullableT()
if (a.e !== null) a.e.funNullableAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funNullableAny()
if (a.e !== null) a.e if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e
if (a.f !== null) a.f.equals(null) if (a.f !== null) a.f.equals(null)
if (a.f !== null) a.f.propT if (a.f !== null) a.f.propT
if (a.f !== null) a.f.propAny if (a.f !== null) a.f.propAny
@@ -2579,36 +2579,36 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val
} }
fun case_30(a: Case30) { fun case_30(a: Case30) {
if (a.x !== null) a.x.equals(null) if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.equals(null)
if (a.x !== null) a.x.propT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propT
if (a.x !== null) a.x.propAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propAny
if (a.x !== null) a.x.propNullableT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propNullableT
if (a.x !== null) a.x.propNullableAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propNullableAny
if (a.x !== null) a.x.funT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funT()
if (a.x !== null) a.x.funAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funAny()
if (a.x !== null) a.x.funNullableT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funNullableT()
if (a.x !== null) a.x.funNullableAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funNullableAny()
if (a.x !== null) a.x if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x
if (a.b !== null) a.b.equals(null) if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.equals(null)
if (a.b !== null) a.b.propT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propT
if (a.b !== null) a.b.propAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propAny
if (a.b !== null) a.b.propNullableT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propNullableT
if (a.b !== null) a.b.propNullableAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propNullableAny
if (a.b !== null) a.b.funT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funT()
if (a.b !== null) a.b.funAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funAny()
if (a.b !== null) a.b.funNullableT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funNullableT()
if (a.b !== null) a.b.funNullableAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funNullableAny()
if (a.b !== null) a.b if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b
if (a.e !== null) a.e.equals(null) if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.equals(null)
if (a.e !== null) a.e.propT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propT
if (a.e !== null) a.e.propAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propAny
if (a.e !== null) a.e.propNullableT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propNullableT
if (a.e !== null) a.e.propNullableAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propNullableAny
if (a.e !== null) a.e.funT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funT()
if (a.e !== null) a.e.funAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funAny()
if (a.e !== null) a.e.funNullableT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funNullableT()
if (a.e !== null) a.e.funNullableAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funNullableAny()
if (a.e !== null) a.e if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e
if (a.f !== null) a.f.equals(null) if (a.f !== null) a.f.equals(null)
if (a.f !== null) a.f.propT if (a.f !== null) a.f.propT
if (a.f !== null) a.f.propAny if (a.f !== null) a.f.propAny
@@ -3624,36 +3624,36 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d:
} }
fun case_31(a: Case31) { fun case_31(a: Case31) {
if (a.x !== null) a.x.equals(null) if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.equals(null)
if (a.x !== null) a.x.propT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propT
if (a.x !== null) a.x.propAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propAny
if (a.x !== null) a.x.propNullableT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propNullableT
if (a.x !== null) a.x.propNullableAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.propNullableAny
if (a.x !== null) a.x.funT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funT()
if (a.x !== null) a.x.funAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funAny()
if (a.x !== null) a.x.funNullableT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funNullableT()
if (a.x !== null) a.x.funNullableAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x.funNullableAny()
if (a.x !== null) a.x if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.x !== null<!>) a.x
if (a.b !== null) a.b.equals(null) if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.equals(null)
if (a.b !== null) a.b.propT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propT
if (a.b !== null) a.b.propAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propAny
if (a.b !== null) a.b.propNullableT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propNullableT
if (a.b !== null) a.b.propNullableAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.propNullableAny
if (a.b !== null) a.b.funT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funT()
if (a.b !== null) a.b.funAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funAny()
if (a.b !== null) a.b.funNullableT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funNullableT()
if (a.b !== null) a.b.funNullableAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b.funNullableAny()
if (a.b !== null) a.b if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.b !== null<!>) a.b
if (a.e !== null) a.e.equals(null) if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.equals(null)
if (a.e !== null) a.e.propT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propT
if (a.e !== null) a.e.propAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propAny
if (a.e !== null) a.e.propNullableT if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propNullableT
if (a.e !== null) a.e.propNullableAny if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.propNullableAny
if (a.e !== null) a.e.funT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funT()
if (a.e !== null) a.e.funAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funAny()
if (a.e !== null) a.e.funNullableT() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funNullableT()
if (a.e !== null) a.e.funNullableAny() if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e.funNullableAny()
if (a.e !== null) a.e if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.e !== null<!>) a.e
if (a.f !== null) a.f.equals(null) if (a.f !== null) a.f.equals(null)
if (a.f !== null) a.f.propT if (a.f !== null) a.f.propT
if (a.f !== null) a.f.propAny if (a.f !== null) a.f.propAny
@@ -114,7 +114,7 @@ fun case_9(x: String?) {
// TESTCASE NUMBER: 10 // TESTCASE NUMBER: 10
fun case_10(x: Float?) { fun case_10(x: Float?) {
if (true && true && true && x !== null) else return if (true && true && true && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x !== null<!>) else return
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!> <!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<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.propT <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.propT
@@ -465,7 +465,7 @@ fun case_33(x: Any?) {
// TESTCASE NUMBER: 34 // TESTCASE NUMBER: 34
fun case_34(x: Float?) { fun case_34(x: Float?) {
(l@ { (l@ {
if (true && true && true && x !== null) else return@l if (true && true && true && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x !== null<!>) else return@l
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!> <!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<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.propT <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.propT
@@ -477,7 +477,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<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.funNullableAny() <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.funNullableAny()
}).equals(l@ { }).equals(l@ {
if (true && true && true && x !== null) else return@l if (true && true && true && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x !== null<!>) else return@l
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!> <!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<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.propT <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.propT
@@ -113,7 +113,7 @@ fun case_9(x: String?) {
// TESTCASE NUMBER: 10 // TESTCASE NUMBER: 10
fun case_10(x: Float?) { fun case_10(x: Float?) {
if (true && true && true && x !== null) else throw Exception() if (true && true && true && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x !== null<!>) else throw Exception()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!> <!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<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.propT <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>x<!>.propT
@@ -124,7 +124,7 @@ fun case_9(list: List<Int?>) {
// TESTCASE NUMBER: 10 // TESTCASE NUMBER: 10
fun case_10(x: Float?) { fun case_10(x: Float?) {
while (false) { while (false) {
if (true && true && true && x !== null) else break if (true && true && true && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x !== null<!>) else break
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float?")!>x<!> <!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<!><!UNSAFE_CALL!>.<!>equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float?")!>x<!>.propT <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float?")!>x<!>.propT
@@ -158,7 +158,7 @@ fun case_11(x: Out<*>?, list: List<Int>) {
// TESTCASE NUMBER: 12 // TESTCASE NUMBER: 12
fun case_12(list: List<Int?>) { fun case_12(list: List<Int?>) {
for (element in list) { for (element in list) {
if (element === null) continue if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>element === null<!>) continue
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>element<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>element<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>element<!>.inv() <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>element<!>.inv()
} }
@@ -213,7 +213,7 @@ fun case_15(map: MutableMap<Int?, Int?>, y: Nothing?) {
// TESTCASE NUMBER: 16 // TESTCASE NUMBER: 16
fun case_16(map: Map<Int?, Int?>) { fun case_16(map: Map<Int?, Int?>) {
for ((k, v) in map) { for ((k, v) in map) {
if (k !== implicitNullableNothingProperty && v !== implicitNullableNothingProperty) else { continue } if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>k !== implicitNullableNothingProperty<!> && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>v !== implicitNullableNothingProperty<!>) else { continue }
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>k<!> <!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")!>k<!>.inv()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>v<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>v<!>
@@ -59,7 +59,7 @@ fun case_7(x: DeepObject.A.B.C.D.E.F.G.J?) {
// TESTCASE NUMBER: 8 // TESTCASE NUMBER: 8
fun case_8(x: Any?) { fun case_8(x: Any?) {
if (x?.equals(10) === null) else { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) === null<!>) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
} }
@@ -67,7 +67,7 @@ fun case_8(x: Any?) {
// TESTCASE NUMBER: 9 // TESTCASE NUMBER: 9
fun case_9(x: Any?) { fun case_9(x: Any?) {
if (x?.equals(10) !== null) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) !== null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
} }
@@ -117,7 +117,7 @@ inline fun <reified T>case_13(x: Any?) {
// TESTCASE NUMBER: 14 // TESTCASE NUMBER: 14
inline fun <reified T>case_14(x: Any?) { inline fun <reified T>case_14(x: Any?) {
if (x?.equals(10) === null) else { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) === null<!>) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
} }
@@ -125,7 +125,7 @@ inline fun <reified T>case_14(x: Any?) {
// TESTCASE NUMBER: 15 // TESTCASE NUMBER: 15
inline fun <reified T>case_15(x: Any?) { inline fun <reified T>case_15(x: Any?) {
if (x?.equals(10) !== null) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) !== null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
} }
@@ -137,7 +137,7 @@ inline fun <reified T>case_15(x: Any?) {
* ISSUES: KT-30369, KT-28262 * ISSUES: KT-30369, KT-28262
*/ */
inline fun <reified T>case_16(x: Any?) { inline fun <reified T>case_16(x: Any?) {
if (x?.equals(10) === null == true) else { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) === null<!> == true) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
} }
@@ -149,7 +149,7 @@ inline fun <reified T>case_16(x: Any?) {
* ISSUES: KT-30369, KT-28262 * ISSUES: KT-30369, KT-28262
*/ */
inline fun <reified T>case_17(x: Any?) { inline fun <reified T>case_17(x: Any?) {
if (x?.equals(10) !== null == true) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) !== null<!> == true) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
} }
@@ -161,7 +161,7 @@ inline fun <reified T>case_17(x: Any?) {
* ISSUES: KT-30369, KT-28262, KT-29878 * ISSUES: KT-30369, KT-28262, KT-29878
*/ */
inline fun <reified T>case_18(x: Any?) { inline fun <reified T>case_18(x: Any?) {
if (<!DEPRECATED_IDENTITY_EQUALS!>x?.equals(10) === null === true<!>) else { if (<!DEPRECATED_IDENTITY_EQUALS!><!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) === null<!> === true<!>) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
} }
@@ -173,7 +173,7 @@ inline fun <reified T>case_18(x: Any?) {
* ISSUES: KT-30369, KT-28262, KT-29878 * ISSUES: KT-30369, KT-28262, KT-29878
*/ */
inline fun <reified T>case_19(x: Any?) { inline fun <reified T>case_19(x: Any?) {
if (<!DEPRECATED_IDENTITY_EQUALS!>x?.equals(10) !== null === true<!>) { if (<!DEPRECATED_IDENTITY_EQUALS!><!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) !== null<!> === true<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
} }
@@ -185,7 +185,7 @@ inline fun <reified T>case_19(x: Any?) {
* ISSUES: KT-30369, KT-28262, KT-29878 * ISSUES: KT-30369, KT-28262, KT-29878
*/ */
inline fun <reified T>case_20(x: Any?) { inline fun <reified T>case_20(x: Any?) {
if (<!DEPRECATED_IDENTITY_EQUALS!>x?.equals(10) === null !== false<!>) else { if (<!DEPRECATED_IDENTITY_EQUALS!><!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) === null<!> !== false<!>) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
} }
@@ -197,7 +197,7 @@ inline fun <reified T>case_20(x: Any?) {
* ISSUES: KT-30369, KT-28262, KT-29878 * ISSUES: KT-30369, KT-28262, KT-29878
*/ */
inline fun <reified T>case_21(x: Any?) { inline fun <reified T>case_21(x: Any?) {
if (<!DEPRECATED_IDENTITY_EQUALS!>x?.equals(10) !== null !== false<!>) { if (<!DEPRECATED_IDENTITY_EQUALS!><!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) !== null<!> !== false<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
} }
@@ -209,7 +209,7 @@ inline fun <reified T>case_21(x: Any?) {
* ISSUES: KT-30369, KT-28262, KT-29878 * ISSUES: KT-30369, KT-28262, KT-29878
*/ */
inline fun <reified T>case_22(x: Any?) { inline fun <reified T>case_22(x: Any?) {
if (<!DEPRECATED_IDENTITY_EQUALS!>x?.equals(10) !== null !== true<!>) else { if (<!DEPRECATED_IDENTITY_EQUALS!><!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) !== null<!> !== true<!>) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
} }
@@ -221,7 +221,7 @@ inline fun <reified T>case_22(x: Any?) {
* ISSUES: KT-30369, KT-28262, KT-29878 * ISSUES: KT-30369, KT-28262, KT-29878
*/ */
inline fun <reified T>case_23(x: Any?) { inline fun <reified T>case_23(x: Any?) {
if (<!DEPRECATED_IDENTITY_EQUALS!>x?.equals(10) === null === false<!>) { if (<!DEPRECATED_IDENTITY_EQUALS!><!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) === null<!> === false<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
} }
@@ -233,7 +233,7 @@ inline fun <reified T>case_23(x: Any?) {
* ISSUES: KT-30369, KT-28262 * ISSUES: KT-30369, KT-28262
*/ */
inline fun <reified T>case_24(x: Any?) { inline fun <reified T>case_24(x: Any?) {
if (x?.equals(10) !== null != true) else { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) !== null<!> != true) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
} }
@@ -245,7 +245,7 @@ inline fun <reified T>case_24(x: Any?) {
* ISSUES: KT-30369, KT-28262 * ISSUES: KT-30369, KT-28262
*/ */
inline fun <reified T>case_25(x: Any?) { inline fun <reified T>case_25(x: Any?) {
if (x?.equals(10) === null == false) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x?.equals(10) === null<!> == false) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
} }
@@ -187,7 +187,7 @@ fun case_16() {
} }
// TESTCASE NUMBER: 17 // TESTCASE NUMBER: 17
val case_17 = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>if (nullableIntProperty !== null) 0 else { val case_17 = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>nullableIntProperty !== null<!>) 0 else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>nullableIntProperty<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>nullableIntProperty<!>
}<!> }<!>
@@ -297,7 +297,7 @@ fun case_25(b: Boolean) {
} }
// TESTCASE NUMBER: 26 // TESTCASE NUMBER: 26
fun case_26(a: Int?, b: Int? = if (a !== null) 0 else <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing?")!>a<!>) { 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<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>b<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>b<!>
} }
@@ -19,7 +19,7 @@ fun case_1(x: Number?) {
fun case_2(x: Number) { fun case_2(x: Number) {
val y: Int? = null val y: Int? = null
if (x === y) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === y<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Int")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Int")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Int")!>x<!>.inv() <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Int")!>x<!>.inv()
} }
@@ -29,7 +29,7 @@ fun case_2(x: Number) {
fun case_3(x: Number) { fun case_3(x: Number) {
var y: Int? = null var y: Int? = null
if (x === y) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>x === y<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Int")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Int")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Int")!>x<!>.inv() <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Int")!>x<!>.inv()
} }
@@ -351,7 +351,7 @@ fun case_15(x: Any?) {
} }
// TESTCASE NUMBER: 16 // TESTCASE NUMBER: 16
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) { 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) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>a<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>a<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>.equals(null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>.equals(null)
@@ -175,7 +175,7 @@ fun case_10() {
val a = Class() val a = Class()
val b = null val b = null
if (a.prop_4 === b || true) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a.prop_4 === b<!> || true) {
if (a.prop_4 != null) { if (a.prop_4 != null) {
a.prop_4 a.prop_4
a.prop_4.equals(null) a.prop_4.equals(null)
@@ -307,7 +307,7 @@ fun case_16() {
} }
// TESTCASE NUMBER: 17 // TESTCASE NUMBER: 17
val case_17 = if (nullableIntProperty === implicitNullableNothingProperty) 0 else { val case_17 = if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>nullableIntProperty === implicitNullableNothingProperty<!>) 0 else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>nullableIntProperty<!> <!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<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>nullableIntProperty<!>.propT <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>nullableIntProperty<!>.propT
@@ -405,7 +405,7 @@ fun case_20(x: Boolean, y: Nothing?) {
// TESTCASE NUMBER: 21 // TESTCASE NUMBER: 21
fun case_21() { fun case_21() {
if (EnumClassWithNullableProperty.A.prop_1 !== implicitNullableNothingProperty) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>EnumClassWithNullableProperty.A.prop_1 !== implicitNullableNothingProperty<!>) {
EnumClassWithNullableProperty.A.prop_1 EnumClassWithNullableProperty.A.prop_1
EnumClassWithNullableProperty.A.prop_1.equals(null) EnumClassWithNullableProperty.A.prop_1.equals(null)
EnumClassWithNullableProperty.A.prop_1.propT EnumClassWithNullableProperty.A.prop_1.propT
@@ -437,9 +437,9 @@ fun case_22(a: (() -> Unit)?) {
// TESTCASE NUMBER: 23 // TESTCASE NUMBER: 23
fun case_23(a: ((Float) -> Int?)?, b: Float?, z: Nothing?) { fun case_23(a: ((Float) -> Int?)?, b: Float?, z: Nothing?) {
if (a != z && b !== z && <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>b !== z<!>) { if (a != z && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>b !== z<!> && <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>b !== z<!>) {
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>b<!>)<!> val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>b<!>)<!>
if (x != z || <!SENSELESS_COMPARISON!>x !== implicitNullableNothingProperty<!>) { if (x != z || <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>x !== implicitNullableNothingProperty<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!><!UNSAFE_CALL!>.<!>equals(null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!><!UNSAFE_CALL!>.<!>equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!>.propT <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!>.propT
@@ -512,7 +512,7 @@ fun case_26(a: ((Float) -> Int?)?, b: Float?) {
if (a != z == true && b != implicitNullableNothingProperty == true) { 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<!>)<!> val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>b<!>)<!>
if (x != implicitNullableNothingProperty == true || <!SENSELESS_COMPARISON!>z !== x<!>) { if (x != implicitNullableNothingProperty == true || <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>z !== x<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>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<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>.propT <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>.propT
@@ -613,7 +613,7 @@ fun case_30(a: ((Float) -> Int?)?, b: Float?) {
// TESTCASE NUMBER: 31 // TESTCASE NUMBER: 31
fun case_31(z1: Boolean?, z: Nothing?) { fun case_31(z1: Boolean?, z: Nothing?) {
if (false || EnumClassWithNullableProperty.A.prop_1 != z && z1 !== z && z1) { if (false || EnumClassWithNullableProperty.A.prop_1 != z && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>z1 !== z<!> && z1) {
EnumClassWithNullableProperty.A.prop_1 EnumClassWithNullableProperty.A.prop_1
EnumClassWithNullableProperty.A.prop_1<!UNSAFE_CALL!>.<!>equals(null) EnumClassWithNullableProperty.A.prop_1<!UNSAFE_CALL!>.<!>equals(null)
EnumClassWithNullableProperty.A.prop_1.propT EnumClassWithNullableProperty.A.prop_1.propT
@@ -652,7 +652,7 @@ fun case_33(a: ((Float) -> Int?)?, b: Float?, c: Boolean?) {
} else { } else {
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!><!UNSAFE_IMPLICIT_INVOKE_CALL!>a<!>(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>b<!>)<!> 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 && <!SENSELESS_COMPARISON!>x === z<!> || (c != z && !c)) { if (x == z == true && <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>x === z<!> || (c != z && !c)) {
} else { } else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>x<!>
@@ -917,7 +917,7 @@ fun case_51() {
} }
// TESTCASE NUMBER: 52 // TESTCASE NUMBER: 52
val case_52 = if (nullableIntProperty !== nullableNothingProperty && <!SENSELESS_COMPARISON!>nullableNothingProperty != nullableIntProperty<!>) 0 else { val case_52 = if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>nullableIntProperty !== nullableNothingProperty<!> && <!SENSELESS_COMPARISON!>nullableNothingProperty != nullableIntProperty<!>) 0 else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>nullableIntProperty<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>nullableIntProperty<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>nullableIntProperty<!>.hashCode() <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>nullableIntProperty<!>.hashCode()
} }
@@ -1003,7 +1003,7 @@ fun case_57(a: (() -> Unit)) {
* UNEXPECTED BEHAVIOUR * UNEXPECTED BEHAVIOUR
*/ */
fun case_58(a: ((Float) -> Int?)?, b: Float?, z: Nothing?) { fun case_58(a: ((Float) -> Int?)?, b: Float?, z: Nothing?) {
if (a === z && b == z || z == a && z === b) { if (a === z && b == z || z == a && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>z === b<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Float, kotlin.Int?>?")!>a<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Float, kotlin.Int?>?")!>a<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float?")!>b<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float?")!>b<!>
if (a != z) { if (a != z) {
@@ -168,7 +168,7 @@ fun case_9(x: TypealiasNullableString<!REDUNDANT_NULLABLE!>?<!>) {
fun case_10() { fun case_10() {
val a = Class() val a = Class()
if (a.prop_4 === null || <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>a.prop_4 === null<!> || true) { 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) { if (a.prop_4 != null) {
a.prop_4 a.prop_4
a.prop_4.equals(null) a.prop_4.equals(null)
@@ -388,7 +388,7 @@ fun case_20(b: Boolean) {
// TESTCASE NUMBER: 21 // TESTCASE NUMBER: 21
fun case_21() { fun case_21() {
val y = null val y = null
if (EnumClassWithNullableProperty.A.prop_1 !== null && <!SENSELESS_COMPARISON!>y != EnumClassWithNullableProperty.A.prop_1<!>) { if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>EnumClassWithNullableProperty.A.prop_1 !== null<!> && <!SENSELESS_COMPARISON!>y != EnumClassWithNullableProperty.A.prop_1<!>) {
EnumClassWithNullableProperty.A.prop_1 EnumClassWithNullableProperty.A.prop_1
EnumClassWithNullableProperty.A.prop_1.equals(null) EnumClassWithNullableProperty.A.prop_1.equals(null)
EnumClassWithNullableProperty.A.prop_1.propT EnumClassWithNullableProperty.A.prop_1.propT
@@ -421,9 +421,9 @@ fun case_22(a: (() -> Unit)?) {
// TESTCASE NUMBER: 23 // TESTCASE NUMBER: 23
fun case_23(a: ((Float) -> Int?)?, b: Float?, c: Nothing?) { fun case_23(a: ((Float) -> Int?)?, b: Float?, c: Nothing?) {
if (a != null && b !== null || a != c && b !== c) { if (a != null && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>b !== null<!> || a != c && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>b !== c<!>) {
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>b<!>)<!> val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Float")!>b<!>)<!>
if (x != null || <!SENSELESS_COMPARISON!>c !== x<!>) { if (x != null || <!FORBIDDEN_IDENTITY_EQUALS_WARNING, SENSELESS_COMPARISON!>c !== x<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>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<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>.propT <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>.propT
@@ -533,7 +533,7 @@ fun case_27(y: Nothing?) {
//TESTCASE NUMBER: 28 //TESTCASE NUMBER: 28
fun case_28(a: DeepObject.A.B.C.D.E.F.G.J?) = 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 && a.x !== nullableNothingProperty) { if (a != null == true == false == false == false == true == false == true == false == false == true == true && <!FORBIDDEN_IDENTITY_EQUALS_WARNING!>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<!>.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<!>.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 <!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J? & DeepObject.A.B.C.D.E.F.G.J")!>a<!>.propT
@@ -547,13 +547,13 @@ fun case_28(a: DeepObject.A.B.C.D.E.F.G.J?) =
} else -1 } else -1
// TESTCASE NUMBER: 29 // TESTCASE NUMBER: 29
fun case_29(a: Int?, b: Nothing?, c: Int = if (a === b) 0 else a) { fun case_29(a: Int?, b: Nothing?, c: Int = if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a === b<!>) 0 else a) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>b<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>b<!>
} }
// TESTCASE NUMBER: 30 // TESTCASE NUMBER: 30
fun case_30(a: Int?, b: Nothing?, c: Int = if (a === b || <!SENSELESS_COMPARISON!>a == null<!>) 0 else a) { fun case_30(a: Int?, b: Nothing?, c: Int = if (<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>a === b<!> || <!SENSELESS_COMPARISON!>a == null<!>) 0 else a) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int?")!>a<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>b<!> <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>b<!>
} }