[FIR] Let attributes opt-in to participating in ConeClassLikeTypeImpl structural equality
This is required for EnhancedTypeForWarningAttribute because scopes should not be reused between cone types with different values of this attribute. #KT-63208
This commit is contained in:
committed by
Space Team
parent
931cc48def
commit
9189154cae
+19
@@ -25,6 +25,25 @@ class EnhancedTypeForWarningAttribute(
|
||||
|
||||
override val keepInInferredDeclarationType: Boolean
|
||||
get() = true
|
||||
|
||||
override val implementsEquality: Boolean
|
||||
get() = true
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
|
||||
other as EnhancedTypeForWarningAttribute
|
||||
|
||||
if (coneType != other.coneType) return false
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = coneType.hashCode()
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
val ConeAttributes.enhancedTypeForWarning: EnhancedTypeForWarningAttribute? by ConeAttributes.attributeAccessor<EnhancedTypeForWarningAttribute>()
|
||||
|
||||
Reference in New Issue
Block a user