Add raw type comparison for Java (J2K mapping is taken into account)
NB: Java enhancement scope does not perform substitution, so we could have some duplicates inside "type enhancement" testData Related to KT-29937
This commit is contained in:
@@ -14,4 +14,14 @@ import org.jetbrains.kotlin.name.ClassId
|
||||
|
||||
class FirClassSymbol(override val classId: ClassId) : ConeClassSymbol, AbstractFirBasedSymbol<FirRegularClass>() {
|
||||
override fun toLookupTag(): ConeClassLikeLookupTag = ConeClassLikeLookupTagImpl(classId)
|
||||
|
||||
override fun equals(other: Any?): Boolean =
|
||||
other is FirClassSymbol && classId == other.classId && fir == other.fir
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = 31
|
||||
result = result * 19 + classId.hashCode()
|
||||
result = result * 19 + fir.hashCode()
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,16 @@ class FirTypeAliasSymbol(
|
||||
override val classId: ClassId
|
||||
) : ConeTypeAliasSymbol, AbstractFirBasedSymbol<FirTypeAlias>() {
|
||||
override fun toLookupTag(): ConeClassLikeLookupTag = TypeAliasLookupTagImpl(classId)
|
||||
|
||||
override fun equals(other: Any?): Boolean =
|
||||
other is FirTypeAliasSymbol && classId == other.classId && fir == other.fir
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = 31
|
||||
result = result * 19 + classId.hashCode()
|
||||
result = result * 19 + fir.hashCode()
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
class TypeAliasLookupTagImpl(
|
||||
|
||||
@@ -19,4 +19,12 @@ class FirTypeParameterSymbol : AbstractFirBasedSymbol<FirTypeParameter>(), ConeT
|
||||
get() = this
|
||||
|
||||
override fun toLookupTag(): ConeTypeParameterLookupTag = this
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return other is FirTypeParameterSymbol && fir == other.fir
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return fir.hashCode()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user