diff --git a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/symbols/ConeLookupTags.kt b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/symbols/ConeLookupTags.kt index 2329c88390a..855097c730a 100644 --- a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/symbols/ConeLookupTags.kt +++ b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/symbols/ConeLookupTags.kt @@ -31,4 +31,19 @@ interface ConeTypeAliasLookupTag : ConeClassLikeLookupTag interface ConeClassLookupTag : ConeClassLikeLookupTag -class ConeClassLikeLookupTagImpl(override val classId: ClassId) : ConeClassLikeLookupTag +class ConeClassLikeLookupTagImpl(override val classId: ClassId) : ConeClassLikeLookupTag { + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as ConeClassLikeLookupTagImpl + + if (classId != other.classId) return false + + return true + } + + override fun hashCode(): Int { + return classId.hashCode() + } +} diff --git a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/impl/Impl.kt b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/impl/Impl.kt index 6c83588ca8e..9601c98a8b7 100644 --- a/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/impl/Impl.kt +++ b/compiler/fir/cones/src/org/jetbrains/kotlin/fir/types/impl/Impl.kt @@ -15,6 +15,27 @@ open class ConeClassTypeImpl( isNullable: Boolean ) : ConeClassType() { override val nullability: ConeNullability = ConeNullability.create(isNullable) + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as ConeClassTypeImpl + + if (lookupTag != other.lookupTag) return false + if (!typeArguments.contentEquals(other.typeArguments)) return false + if (nullability != other.nullability) return false + + return true + } + + override fun hashCode(): Int { + var result = lookupTag.hashCode() + result = 31 * result + typeArguments.contentHashCode() + result = 31 * result + nullability.hashCode() + return result + } + + } class ConeAbbreviatedTypeImpl(