[FIR] Add tests highlighting false errors in K2 regarding equalities
Some overlooked corner-cases found by Denis.
This commit is contained in:
committed by
Space Team
parent
86e175bbf1
commit
ae521524d6
+14
@@ -96,3 +96,17 @@ fun incompatibleIdentityRegardlessNullabilityWithValueClassesSmartCast(c: Any?,
|
|||||||
<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>c === d<!>
|
<!FORBIDDEN_IDENTITY_EQUALS_WARNING!>c === d<!>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum class F
|
||||||
|
|
||||||
|
fun <T: E, K: F> incompatibleEnumComparisonWithTypeParameters(e: T, f: K) {
|
||||||
|
<!INCOMPATIBLE_ENUM_COMPARISON_ERROR!>e == f<!>
|
||||||
|
}
|
||||||
|
|
||||||
|
interface A
|
||||||
|
enum class G : B
|
||||||
|
|
||||||
|
fun <I : A> incompatibleEnumAndUnrelatedInterfaceThroughTypeParameter(x: G?, i: I?) {
|
||||||
|
<!INCOMPATIBLE_ENUM_COMPARISON_ERROR!>x == i<!>
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
+14
@@ -96,3 +96,17 @@ fun incompatibleIdentityRegardlessNullabilityWithValueClassesSmartCast(c: Any?,
|
|||||||
c === d
|
c === d
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum class F
|
||||||
|
|
||||||
|
fun <T: E, K: F> incompatibleEnumComparisonWithTypeParameters(e: T, f: K) {
|
||||||
|
e == f
|
||||||
|
}
|
||||||
|
|
||||||
|
interface A
|
||||||
|
enum class G : B
|
||||||
|
|
||||||
|
fun <I : A> incompatibleEnumAndUnrelatedInterfaceThroughTypeParameter(x: G?, i: I?) {
|
||||||
|
x == i
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user