Minor, remove TypeSystemContext.isNotNullNothing
Use equivalent isNothing instead
This commit is contained in:
@@ -347,12 +347,6 @@ interface ConeTypeContext : TypeSystemContext, TypeSystemOptimizationContext {
|
|||||||
return this is ConeClassLikeSymbol && classId == StandardClassIds.Nothing
|
return this is ConeClassLikeSymbol && classId == StandardClassIds.Nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun KotlinTypeMarker.isNotNullNothing(): Boolean {
|
|
||||||
require(this is ConeKotlinType)
|
|
||||||
return typeConstructor().isNothingConstructor() && !this.nullability.isNullable
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
override fun SimpleTypeMarker.isSingleClassifierType(): Boolean {
|
override fun SimpleTypeMarker.isSingleClassifierType(): Boolean {
|
||||||
if (isError()) return false
|
if (isError()) return false
|
||||||
if (this is ConeCapturedType) return true
|
if (this is ConeCapturedType) return true
|
||||||
|
|||||||
@@ -174,11 +174,6 @@ interface IrTypeSystemContext : TypeSystemInferenceExtensionContext {
|
|||||||
|
|
||||||
override fun TypeConstructorMarker.isNothingConstructor() = this === irBuiltIns.nothingClass
|
override fun TypeConstructorMarker.isNothingConstructor() = this === irBuiltIns.nothingClass
|
||||||
|
|
||||||
override fun KotlinTypeMarker.isNotNullNothing(): Boolean {
|
|
||||||
val simpleType = this as? IrSimpleType ?: return false
|
|
||||||
return simpleType == irBuiltIns.nothingType && !simpleType.hasQuestionMark
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun SimpleTypeMarker.isSingleClassifierType() = true
|
override fun SimpleTypeMarker.isSingleClassifierType() = true
|
||||||
|
|
||||||
override fun SimpleTypeMarker.possibleIntegerTypes() = irBuiltIns.run {
|
override fun SimpleTypeMarker.possibleIntegerTypes() = irBuiltIns.run {
|
||||||
|
|||||||
@@ -261,11 +261,6 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext {
|
|||||||
(constructor.declarationDescriptor != null || this is CapturedType || this is NewCapturedType || this is DefinitelyNotNullType || constructor is IntegerLiteralTypeConstructor)
|
(constructor.declarationDescriptor != null || this is CapturedType || this is NewCapturedType || this is DefinitelyNotNullType || constructor is IntegerLiteralTypeConstructor)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun KotlinTypeMarker.isNotNullNothing(): Boolean {
|
|
||||||
require(this is KotlinType, this::errorMessage)
|
|
||||||
return typeConstructor().isNothingConstructor() && !TypeUtils.isNullableType(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun KotlinTypeMarker.contains(predicate: (KotlinTypeMarker) -> Boolean): Boolean {
|
override fun KotlinTypeMarker.contains(predicate: (KotlinTypeMarker) -> Boolean): Boolean {
|
||||||
require(this is KotlinType, this::errorMessage)
|
require(this is KotlinType, this::errorMessage)
|
||||||
return containsInternal(this, predicate)
|
return containsInternal(this, predicate)
|
||||||
|
|||||||
@@ -538,7 +538,7 @@ object AbstractNullabilityChecker {
|
|||||||
|
|
||||||
fun AbstractTypeCheckerContext.hasPathByNotMarkedNullableNodes(start: SimpleTypeMarker, end: TypeConstructorMarker) =
|
fun AbstractTypeCheckerContext.hasPathByNotMarkedNullableNodes(start: SimpleTypeMarker, end: TypeConstructorMarker) =
|
||||||
anySupertype(start, {
|
anySupertype(start, {
|
||||||
it.isNotNullNothing() || (!it.isMarkedNullable() && isEqualTypeConstructors(it.typeConstructor(), end))
|
it.isNothing() || (!it.isMarkedNullable() && isEqualTypeConstructors(it.typeConstructor(), end))
|
||||||
}) {
|
}) {
|
||||||
if (it.isMarkedNullable()) SupertypesPolicy.None else SupertypesPolicy.LowerIfFlexible
|
if (it.isMarkedNullable()) SupertypesPolicy.None else SupertypesPolicy.LowerIfFlexible
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,8 +255,6 @@ interface TypeSystemContext : TypeSystemOptimizationContext {
|
|||||||
fun TypeConstructorMarker.isAnyConstructor(): Boolean
|
fun TypeConstructorMarker.isAnyConstructor(): Boolean
|
||||||
fun TypeConstructorMarker.isNothingConstructor(): Boolean
|
fun TypeConstructorMarker.isNothingConstructor(): Boolean
|
||||||
|
|
||||||
fun KotlinTypeMarker.isNotNullNothing(): Boolean
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* SingleClassifierType is one of the following types:
|
* SingleClassifierType is one of the following types:
|
||||||
|
|||||||
Reference in New Issue
Block a user