FIR: make ConeSimpleKotlinType the only original for definitely not-null

This commit is contained in:
Mikhail Glukhikh
2021-12-13 18:24:45 +03:00
committed by TeamCityServer
parent 434213f416
commit 81ff9b820a
4 changed files with 12 additions and 8 deletions
@@ -135,7 +135,9 @@ internal class KtFirTypeProvider(
return when (this) {
// We also need to collect those on `upperBound` due to nullability.
is ConeFlexibleType -> lowerBound.getDirectSuperTypes(shouldApproximate) + upperBound.getDirectSuperTypes(shouldApproximate)
is ConeDefinitelyNotNullType -> original.getDirectSuperTypes(shouldApproximate).map { ConeDefinitelyNotNullType(it) }
is ConeDefinitelyNotNullType -> original.getDirectSuperTypes(shouldApproximate).map {
ConeDefinitelyNotNullType.create(it, analysisSession.rootModuleSession.typeContext) ?: it
}
is ConeIntersectionType -> intersectedTypes.asSequence().flatMap { it.getDirectSuperTypes(shouldApproximate) }
is ConeClassErrorType -> emptySequence()
is ConeLookupTagBasedType -> getSubstitutedSuperTypes(shouldApproximate)