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