[FIR JS] Support DYNAMIC_RECEIVER_NOT_ALLOWED

This commit is contained in:
Nikolay Lunyak
2023-01-04 15:05:45 +02:00
committed by Space Team
parent 0f876f665a
commit 227969d787
21 changed files with 68 additions and 51 deletions
@@ -2022,6 +2022,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirErrors.DYNAMIC_RECEIVER_NOT_ALLOWED) { firDiagnostic ->
DynamicReceiverNotAllowedImpl(
firDiagnostic as KtPsiDiagnostic,
token,
)
}
add(FirErrors.INCOMPATIBLE_TYPES) { firDiagnostic ->
IncompatibleTypesImpl(
firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a),
@@ -1435,6 +1435,10 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
override val diagnosticClass get() = DynamicUpperBound::class
}
abstract class DynamicReceiverNotAllowed : KtFirDiagnostic<KtElement>() {
override val diagnosticClass get() = DynamicReceiverNotAllowed::class
}
abstract class IncompatibleTypes : KtFirDiagnostic<KtElement>() {
override val diagnosticClass get() = IncompatibleTypes::class
abstract val typeA: KtType
@@ -1727,6 +1727,11 @@ internal class DynamicUpperBoundImpl(
override val token: KtLifetimeToken,
) : KtFirDiagnostic.DynamicUpperBound(), KtAbstractFirDiagnostic<KtTypeReference>
internal class DynamicReceiverNotAllowedImpl(
override val firDiagnostic: KtPsiDiagnostic,
override val token: KtLifetimeToken,
) : KtFirDiagnostic.DynamicReceiverNotAllowed(), KtAbstractFirDiagnostic<KtElement>
internal class IncompatibleTypesImpl(
override val typeA: KtType,
override val typeB: KtType,