[FIR] Ensure K2 doesn't report Int? === String?
This commit is contained in:
committed by
Space Team
parent
898ed7658a
commit
5ecedcbb16
+24
@@ -72,3 +72,27 @@ fun incompatibleEnumComparisonSmartCast(c: Any?, e: Any?) {
|
|||||||
<!INCOMPATIBLE_ENUM_COMPARISON!>c == e<!>
|
<!INCOMPATIBLE_ENUM_COMPARISON!>c == e<!>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun incompatibleIdentityRegardlessNullability(a: Int?, b: String?) {
|
||||||
|
<!EQUALITY_NOT_APPLICABLE!>a == b<!>
|
||||||
|
a === b
|
||||||
|
}
|
||||||
|
|
||||||
|
fun incompatibleIdentityRegardlessNullabilitySmartCast(a: Any?, b: Any?) {
|
||||||
|
if (a is Int? && b is String?) {
|
||||||
|
<!EQUALITY_NOT_APPLICABLE_WARNING!>a == b<!>
|
||||||
|
a === b
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun incompatibleIdentityRegardlessNullabilityWithValueClasses(c: C?, d: D?) {
|
||||||
|
c == d
|
||||||
|
c === d
|
||||||
|
}
|
||||||
|
|
||||||
|
fun incompatibleIdentityRegardlessNullabilityWithValueClassesSmartCast(c: Any?, d: Any?) {
|
||||||
|
if (c is C? && d is D?) {
|
||||||
|
c == d
|
||||||
|
c === d
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
+24
@@ -72,3 +72,27 @@ fun incompatibleEnumComparisonSmartCast(c: Any?, e: Any?) {
|
|||||||
c == e
|
c == e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun incompatibleIdentityRegardlessNullability(a: Int?, b: String?) {
|
||||||
|
<!EQUALITY_NOT_APPLICABLE!>a == b<!>
|
||||||
|
<!EQUALITY_NOT_APPLICABLE!>a === b<!>
|
||||||
|
}
|
||||||
|
|
||||||
|
fun incompatibleIdentityRegardlessNullabilitySmartCast(a: Any?, b: Any?) {
|
||||||
|
if (a is Int? && b is String?) {
|
||||||
|
a == b
|
||||||
|
a === b
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun incompatibleIdentityRegardlessNullabilityWithValueClasses(c: C?, d: D?) {
|
||||||
|
<!EQUALITY_NOT_APPLICABLE!>c == d<!>
|
||||||
|
<!EQUALITY_NOT_APPLICABLE, FORBIDDEN_IDENTITY_EQUALS!>c === d<!>
|
||||||
|
}
|
||||||
|
|
||||||
|
fun incompatibleIdentityRegardlessNullabilityWithValueClassesSmartCast(c: Any?, d: Any?) {
|
||||||
|
if (c is C? && d is D?) {
|
||||||
|
c == d
|
||||||
|
c === d
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user