diff --git a/native/commonizer/src/org/jetbrains/kotlin/descriptors/commonizer/cir/CirType.kt b/native/commonizer/src/org/jetbrains/kotlin/descriptors/commonizer/cir/CirType.kt index 603a4c6e0a5..bc3bf7d7246 100644 --- a/native/commonizer/src/org/jetbrains/kotlin/descriptors/commonizer/cir/CirType.kt +++ b/native/commonizer/src/org/jetbrains/kotlin/descriptors/commonizer/cir/CirType.kt @@ -11,9 +11,7 @@ import org.jetbrains.kotlin.types.Variance typealias CirTypeSignature = String -sealed class CirType { - abstract val signature: CirTypeSignature -} +sealed class CirType /** * All attributes are read from the abbreviation type: [AbbreviatedType.abbreviation]. @@ -33,9 +31,6 @@ abstract class CirSimpleType : CirType(), CirHasVisibility { abstract val isDefinitelyNotNullType: Boolean } -data class CirTypeProjection(val projectionKind: Variance, val isStarProjection: Boolean, val type: CirType) +data class CirFlexibleType(val lowerBound: CirSimpleType, val upperBound: CirSimpleType) : CirType() -data class CirFlexibleType(val lowerBound: CirSimpleType, val upperBound: CirSimpleType) : CirType() { - override val signature: CirTypeSignature - get() = lowerBound.signature -} +data class CirTypeProjection(val projectionKind: Variance, val isStarProjection: Boolean, val type: CirType) diff --git a/native/commonizer/src/org/jetbrains/kotlin/descriptors/commonizer/cir/factory/CirTypeFactory.kt b/native/commonizer/src/org/jetbrains/kotlin/descriptors/commonizer/cir/factory/CirTypeFactory.kt index 30e92bfaa9f..86ded8ab67c 100644 --- a/native/commonizer/src/org/jetbrains/kotlin/descriptors/commonizer/cir/factory/CirTypeFactory.kt +++ b/native/commonizer/src/org/jetbrains/kotlin/descriptors/commonizer/cir/factory/CirTypeFactory.kt @@ -13,7 +13,6 @@ import org.jetbrains.kotlin.descriptors.commonizer.cir.* import org.jetbrains.kotlin.descriptors.commonizer.cir.impl.CirSimpleTypeImpl import org.jetbrains.kotlin.descriptors.commonizer.utils.Interner import org.jetbrains.kotlin.descriptors.commonizer.utils.declarationDescriptor -import org.jetbrains.kotlin.descriptors.commonizer.utils.signature import org.jetbrains.kotlin.types.* object CirTypeFactory { @@ -41,8 +40,7 @@ object CirTypeFactory { ) }, isMarkedNullable = abbreviation.isMarkedNullable, - isDefinitelyNotNullType = abbreviation.isDefinitelyNotNullType, - signature = source.signature + isDefinitelyNotNullType = abbreviation.isDefinitelyNotNullType ) } @@ -51,8 +49,7 @@ object CirTypeFactory { visibility: Visibility, arguments: List, isMarkedNullable: Boolean, - isDefinitelyNotNullType: Boolean, - signature: CirTypeSignature + isDefinitelyNotNullType: Boolean ): CirSimpleType { return interner.intern( CirSimpleTypeImpl( @@ -60,8 +57,7 @@ object CirTypeFactory { visibility = visibility, arguments = arguments, isMarkedNullable = isMarkedNullable, - isDefinitelyNotNullType = isDefinitelyNotNullType, - signature = signature + isDefinitelyNotNullType = isDefinitelyNotNullType ) ) } diff --git a/native/commonizer/src/org/jetbrains/kotlin/descriptors/commonizer/cir/impl/CirSimpleTypeImpl.kt b/native/commonizer/src/org/jetbrains/kotlin/descriptors/commonizer/cir/impl/CirSimpleTypeImpl.kt index 59469774f97..1b5c0e84f32 100644 --- a/native/commonizer/src/org/jetbrains/kotlin/descriptors/commonizer/cir/impl/CirSimpleTypeImpl.kt +++ b/native/commonizer/src/org/jetbrains/kotlin/descriptors/commonizer/cir/impl/CirSimpleTypeImpl.kt @@ -15,8 +15,7 @@ data class CirSimpleTypeImpl( override val visibility: Visibility, // visibility of the classifier descriptor override val arguments: List, override val isMarkedNullable: Boolean, - override val isDefinitelyNotNullType: Boolean, - override val signature: CirTypeSignature + override val isDefinitelyNotNullType: Boolean ) : CirSimpleType() { // See also org.jetbrains.kotlin.types.KotlinType.cachedHashCode private var cachedHashCode = 0 @@ -26,7 +25,6 @@ data class CirSimpleTypeImpl( .appendHashCode(arguments) .appendHashCode(isMarkedNullable) .appendHashCode(isDefinitelyNotNullType) - .appendHashCode(signature) override fun hashCode(): Int { var currentHashCode = cachedHashCode @@ -44,7 +42,6 @@ data class CirSimpleTypeImpl( && classifierId == other.classifierId && visibility == other.visibility && arguments == other.arguments - && signature == other.signature && isDefinitelyNotNullType == other.isDefinitelyNotNullType } else -> false diff --git a/native/commonizer/src/org/jetbrains/kotlin/descriptors/commonizer/core/AnnotationsCommonizer.kt b/native/commonizer/src/org/jetbrains/kotlin/descriptors/commonizer/core/AnnotationsCommonizer.kt index 341bb33d41b..0fcac0afb83 100644 --- a/native/commonizer/src/org/jetbrains/kotlin/descriptors/commonizer/core/AnnotationsCommonizer.kt +++ b/native/commonizer/src/org/jetbrains/kotlin/descriptors/commonizer/core/AnnotationsCommonizer.kt @@ -165,8 +165,7 @@ private class DeprecatedAnnotationCommonizer : Commonizer> = linkedMapOf() // preserve supertype order + val supertypesMap: MutableMap> = linkedMapOf() // preserve supertype order node.targetDeclarations.forEachIndexed { index, clazz -> for (supertype in clazz!!.supertypes) { - supertypesMap.getOrPut(supertype.signature) { CommonizedGroup(node.targetDeclarations.size) }[index] = supertype + supertypesMap.getOrPut(supertype) { CommonizedGroup(node.targetDeclarations.size) }[index] = supertype } }