[Commonizer] Remove isDefinitelyNotNullType from CirSimpleType
This commit is contained in:
+1
-6
@@ -132,15 +132,10 @@ internal fun CirSimpleType.buildType(
|
||||
kotlinTypeRefiner = null
|
||||
)
|
||||
|
||||
val computedType = if (classifier is TypeAliasDescriptor)
|
||||
return if (classifier is TypeAliasDescriptor)
|
||||
classifier.underlyingType.withAbbreviation(simpleType)
|
||||
else
|
||||
simpleType
|
||||
|
||||
return if (isDefinitelyNotNullType)
|
||||
computedType.makeSimpleTypeDefinitelyNotNullOrNotNull()
|
||||
else
|
||||
computedType
|
||||
}
|
||||
|
||||
internal fun findClassOrTypeAlias(
|
||||
|
||||
@@ -28,7 +28,6 @@ abstract class CirSimpleType : CirType(), CirHasVisibility {
|
||||
abstract val classifierId: CirClassifierId
|
||||
abstract val arguments: List<CirTypeProjection>
|
||||
abstract val isMarkedNullable: Boolean
|
||||
abstract val isDefinitelyNotNullType: Boolean
|
||||
}
|
||||
|
||||
data class CirFlexibleType(val lowerBound: CirSimpleType, val upperBound: CirSimpleType) : CirType()
|
||||
|
||||
+3
-6
@@ -39,8 +39,7 @@ object CirTypeFactory {
|
||||
type = create(projection.type)
|
||||
)
|
||||
},
|
||||
isMarkedNullable = abbreviation.isMarkedNullable,
|
||||
isDefinitelyNotNullType = abbreviation.isDefinitelyNotNullType
|
||||
isMarkedNullable = abbreviation.isMarkedNullable
|
||||
)
|
||||
}
|
||||
|
||||
@@ -48,16 +47,14 @@ object CirTypeFactory {
|
||||
classifierId: CirClassifierId,
|
||||
visibility: Visibility,
|
||||
arguments: List<CirTypeProjection>,
|
||||
isMarkedNullable: Boolean,
|
||||
isDefinitelyNotNullType: Boolean
|
||||
isMarkedNullable: Boolean
|
||||
): CirSimpleType {
|
||||
return interner.intern(
|
||||
CirSimpleTypeImpl(
|
||||
classifierId = classifierId,
|
||||
visibility = visibility,
|
||||
arguments = arguments,
|
||||
isMarkedNullable = isMarkedNullable,
|
||||
isDefinitelyNotNullType = isDefinitelyNotNullType
|
||||
isMarkedNullable = isMarkedNullable
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
+1
-4
@@ -14,8 +14,7 @@ data class CirSimpleTypeImpl(
|
||||
override val classifierId: CirClassifierId,
|
||||
override val visibility: Visibility, // visibility of the classifier descriptor
|
||||
override val arguments: List<CirTypeProjection>,
|
||||
override val isMarkedNullable: Boolean,
|
||||
override val isDefinitelyNotNullType: Boolean
|
||||
override val isMarkedNullable: Boolean
|
||||
) : CirSimpleType() {
|
||||
// See also org.jetbrains.kotlin.types.KotlinType.cachedHashCode
|
||||
private var cachedHashCode = 0
|
||||
@@ -24,7 +23,6 @@ data class CirSimpleTypeImpl(
|
||||
.appendHashCode(visibility)
|
||||
.appendHashCode(arguments)
|
||||
.appendHashCode(isMarkedNullable)
|
||||
.appendHashCode(isDefinitelyNotNullType)
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var currentHashCode = cachedHashCode
|
||||
@@ -42,7 +40,6 @@ data class CirSimpleTypeImpl(
|
||||
&& classifierId == other.classifierId
|
||||
&& visibility == other.visibility
|
||||
&& arguments == other.arguments
|
||||
&& isDefinitelyNotNullType == other.isDefinitelyNotNullType
|
||||
}
|
||||
else -> false
|
||||
}
|
||||
|
||||
+1
-2
@@ -164,8 +164,7 @@ private class DeprecatedAnnotationCommonizer : Commonizer<CirAnnotation, CirAnno
|
||||
classifierId = CirClassifierIdFactory.createForClass(classId),
|
||||
visibility = Visibilities.PUBLIC,
|
||||
arguments = emptyList(),
|
||||
isMarkedNullable = false,
|
||||
isDefinitelyNotNullType = false
|
||||
isMarkedNullable = false
|
||||
)
|
||||
|
||||
private fun CirAnnotation.getDeprecationMessage(): String? = constantValueArguments.getString(PROPERTY_NAME_MESSAGE)
|
||||
|
||||
+1
-4
@@ -40,10 +40,7 @@ private fun areSimpleTypesEqual(cache: CirClassifiersCache, a: CirSimpleType, b:
|
||||
val bId = b.classifierId
|
||||
|
||||
if (a !== b) {
|
||||
if (a.arguments.size != b.arguments.size
|
||||
|| a.isMarkedNullable != b.isMarkedNullable
|
||||
|| a.isDefinitelyNotNullType != b.isDefinitelyNotNullType
|
||||
) {
|
||||
if (a.arguments.size != b.arguments.size || a.isMarkedNullable != b.isMarkedNullable) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user