Add equals/hashCode to some FIR cone types
This commit is contained in:
committed by
Mikhail Glukhikh
parent
aa96837758
commit
9266a2cdba
@@ -30,12 +30,12 @@ interface ConeTypedProjection {
|
||||
val type: ConeKotlinType
|
||||
}
|
||||
|
||||
class ConeKotlinTypeProjectionIn(override val type: ConeKotlinType) : ConeKotlinTypeProjection(), ConeTypedProjection {
|
||||
data class ConeKotlinTypeProjectionIn(override val type: ConeKotlinType) : ConeKotlinTypeProjection(), ConeTypedProjection {
|
||||
override val kind: ProjectionKind
|
||||
get() = ProjectionKind.IN
|
||||
}
|
||||
|
||||
class ConeKotlinTypeProjectionOut(override val type: ConeKotlinType) : ConeKotlinTypeProjection(), ConeTypedProjection {
|
||||
data class ConeKotlinTypeProjectionOut(override val type: ConeKotlinType) : ConeKotlinTypeProjection(), ConeTypedProjection {
|
||||
override val kind: ProjectionKind
|
||||
get() = ProjectionKind.OUT
|
||||
}
|
||||
|
||||
@@ -57,4 +57,24 @@ class ConeTypeParameterTypeImpl(
|
||||
get() = EMPTY_ARRAY
|
||||
|
||||
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 ConeTypeParameterTypeImpl
|
||||
|
||||
if (lookupTag != other.lookupTag) return false
|
||||
if (nullability != other.nullability) return false
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = lookupTag.hashCode()
|
||||
result = 31 * result + nullability.hashCode()
|
||||
return result
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user