FIR IDE: introduce KtFirDefinitelyNotNullType
This commit is contained in:
committed by
TeamCityServer
parent
8177a70ff9
commit
73bb2e76f2
@@ -57,6 +57,12 @@ abstract class KtTypeParameterType : KtTypeWithNullability {
|
||||
|
||||
abstract class KtCapturedType : KtType
|
||||
|
||||
abstract class KtDefinitelyNotNullType : KtType, KtTypeWithNullability {
|
||||
abstract val original: KtType
|
||||
|
||||
final override val nullability: KtTypeNullability get() = KtTypeNullability.NON_NULLABLE
|
||||
}
|
||||
|
||||
abstract class KtFlexibleType : KtType {
|
||||
abstract val lowerBound: KtType
|
||||
abstract val upperBound: KtType
|
||||
|
||||
+1
-1
@@ -319,7 +319,7 @@ internal class KtSymbolByFirBuilder private constructor(
|
||||
is ConeClassErrorType -> KtFirClassErrorType(coneType, token)
|
||||
is ConeFlexibleType -> KtFirFlexibleType(coneType, token, this@KtSymbolByFirBuilder)
|
||||
is ConeIntersectionType -> KtFirIntersectionType(coneType, token, this@KtSymbolByFirBuilder)
|
||||
is ConeDefinitelyNotNullType -> buildKtType(coneType.original)
|
||||
is ConeDefinitelyNotNullType -> KtFirDefinitelyNotNullType(coneType, token, this@KtSymbolByFirBuilder)
|
||||
is ConeCapturedType -> KtFirCapturedType(coneType, token)
|
||||
else -> throwUnexpectedElementError(coneType)
|
||||
}
|
||||
|
||||
+13
@@ -109,6 +109,19 @@ internal class KtFirCapturedType(
|
||||
override fun asStringForDebugging(): String = withValidityAssertion { coneType.render() }
|
||||
}
|
||||
|
||||
internal class KtFirDefinitelyNotNullType(
|
||||
coneType: ConeDefinitelyNotNullType,
|
||||
override val token: ValidityToken,
|
||||
private val firBuilder: KtSymbolByFirBuilder,
|
||||
) : KtDefinitelyNotNullType(), KtFirType {
|
||||
override val coneType by weakRef(coneType)
|
||||
|
||||
override val original: KtType by cached { firBuilder.typeBuilder.buildKtType(this.coneType.original) }
|
||||
|
||||
override fun asStringForDebugging(): String = withValidityAssertion { coneType.render() }
|
||||
}
|
||||
|
||||
|
||||
|
||||
internal class KtFirTypeParameterType(
|
||||
coneType: ConeTypeParameterType,
|
||||
|
||||
Reference in New Issue
Block a user