[FIR] Add tests highlighting false errors in K2 regarding equalities

Some overlooked corner-cases found by Denis.
This commit is contained in:
Nikolay Lunyak
2023-10-18 17:50:36 +03:00
committed by Space Team
parent 86e175bbf1
commit ae521524d6
2 changed files with 28 additions and 0 deletions
@@ -96,3 +96,17 @@ fun incompatibleIdentityRegardlessNullabilityWithValueClassesSmartCast(c: Any?,
<!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<!>
}
@@ -96,3 +96,17 @@ fun incompatibleIdentityRegardlessNullabilityWithValueClassesSmartCast(c: Any?,
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
}