[FIR] Relax incompatibleEnumComparisonWithTypeParameters
This commit is contained in:
committed by
Space Team
parent
ae521524d6
commit
3058f2eaff
+1
-1
@@ -53,7 +53,7 @@ object FirEqualityCompatibilityChecker : FirEqualityOperatorCallChecker() {
|
|||||||
// sees a non-empty intersection and none of the
|
// sees a non-empty intersection and none of the
|
||||||
// types is an enum, but intersections in K1
|
// types is an enum, but intersections in K1
|
||||||
// work differently from intersections in K2.
|
// work differently from intersections in K2.
|
||||||
val isCaseMissedByK1 = it != Applicability.INAPPLICABLE_AS_ENUMS
|
val isCaseMissedByK1 = (l.originalTypeInfo.isEnumClass == r.originalTypeInfo.isEnumClass)
|
||||||
&& l.originalTypeInfo.isLiterallyTypeParameter
|
&& l.originalTypeInfo.isLiterallyTypeParameter
|
||||||
&& r.originalTypeInfo.isLiterallyTypeParameter
|
&& r.originalTypeInfo.isLiterallyTypeParameter
|
||||||
val replicateK1Behavior = !context.languageVersionSettings.supportsFeature(LanguageFeature.ReportErrorsForComparisonOperators)
|
val replicateK1Behavior = !context.languageVersionSettings.supportsFeature(LanguageFeature.ReportErrorsForComparisonOperators)
|
||||||
|
|||||||
+1
-1
@@ -100,7 +100,7 @@ fun incompatibleIdentityRegardlessNullabilityWithValueClassesSmartCast(c: Any?,
|
|||||||
enum class F
|
enum class F
|
||||||
|
|
||||||
fun <T: E, K: F> incompatibleEnumComparisonWithTypeParameters(e: T, f: K) {
|
fun <T: E, K: F> incompatibleEnumComparisonWithTypeParameters(e: T, f: K) {
|
||||||
<!INCOMPATIBLE_ENUM_COMPARISON_ERROR!>e == f<!>
|
<!INCOMPATIBLE_ENUM_COMPARISON!>e == f<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
interface A
|
interface A
|
||||||
|
|||||||
Reference in New Issue
Block a user