Minor, remove TypeSystemContext.isNotNullNothing

Use equivalent isNothing instead
This commit is contained in:
Alexander Udalov
2019-06-27 01:00:10 +02:00
parent c452934f5b
commit 331f0291ce
5 changed files with 1 additions and 19 deletions
@@ -261,11 +261,6 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext {
(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 {
require(this is KotlinType, this::errorMessage)
return containsInternal(this, predicate)
@@ -538,7 +538,7 @@ object AbstractNullabilityChecker {
fun AbstractTypeCheckerContext.hasPathByNotMarkedNullableNodes(start: SimpleTypeMarker, end: TypeConstructorMarker) =
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
}
@@ -255,8 +255,6 @@ interface TypeSystemContext : TypeSystemOptimizationContext {
fun TypeConstructorMarker.isAnyConstructor(): Boolean
fun TypeConstructorMarker.isNothingConstructor(): Boolean
fun KotlinTypeMarker.isNotNullNothing(): Boolean
/**
*
* SingleClassifierType is one of the following types: