[JS FIR] Support DYNAMIC_NOT_ALLOWED diagnostic

^KT-59384 Fixed
This commit is contained in:
Alexander Korepanov
2023-07-13 17:29:23 +02:00
committed by Space Team
parent 39fba56de9
commit 6034d32d7c
8 changed files with 53 additions and 22 deletions
@@ -3779,6 +3779,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirErrors.DYNAMIC_NOT_ALLOWED) { firDiagnostic ->
DynamicNotAllowedImpl(
firDiagnostic as KtPsiDiagnostic,
token,
)
}
add(FirErrors.ENUM_ENTRY_AS_TYPE) { firDiagnostic ->
EnumEntryAsTypeImpl(
firDiagnostic as KtPsiDiagnostic,
@@ -2641,6 +2641,10 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
override val diagnosticClass get() = IsEnumEntry::class
}
interface DynamicNotAllowed : KtFirDiagnostic<KtTypeReference> {
override val diagnosticClass get() = DynamicNotAllowed::class
}
interface EnumEntryAsType : KtFirDiagnostic<KtTypeReference> {
override val diagnosticClass get() = EnumEntryAsType::class
}
@@ -3183,6 +3183,11 @@ internal class IsEnumEntryImpl(
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtTypeReference>(firDiagnostic, token), KtFirDiagnostic.IsEnumEntry
internal class DynamicNotAllowedImpl(
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtTypeReference>(firDiagnostic, token), KtFirDiagnostic.DynamicNotAllowed
internal class EnumEntryAsTypeImpl(
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,