FIR IDE: introduce KtCapturedType

This commit is contained in:
Ilya Kirillov
2021-06-09 19:19:37 +02:00
committed by TeamCityServer
parent e2cfd933f1
commit 8177a70ff9
3 changed files with 12 additions and 0 deletions
@@ -55,6 +55,8 @@ abstract class KtTypeParameterType : KtTypeWithNullability {
abstract val symbol: KtTypeParameterSymbol
}
abstract class KtCapturedType : KtType
abstract class KtFlexibleType : KtType {
abstract val lowerBound: KtType
abstract val upperBound: KtType
@@ -320,6 +320,7 @@ internal class KtSymbolByFirBuilder private constructor(
is ConeFlexibleType -> KtFirFlexibleType(coneType, token, this@KtSymbolByFirBuilder)
is ConeIntersectionType -> KtFirIntersectionType(coneType, token, this@KtSymbolByFirBuilder)
is ConeDefinitelyNotNullType -> buildKtType(coneType.original)
is ConeCapturedType -> KtFirCapturedType(coneType, token)
else -> throwUnexpectedElementError(coneType)
}
}
@@ -101,6 +101,15 @@ internal class KtFirClassErrorType(
override fun asStringForDebugging(): String = withValidityAssertion { coneType.render() }
}
internal class KtFirCapturedType(
coneType: ConeCapturedType,
override val token: ValidityToken,
) : KtCapturedType(), KtFirType {
override val coneType by weakRef(coneType)
override fun asStringForDebugging(): String = withValidityAssertion { coneType.render() }
}
internal class KtFirTypeParameterType(
coneType: ConeTypeParameterType,
override val token: ValidityToken,