[JS FIR] Support EXTERNAL_INTERFACE_AS_REIFIED_TYPE_ARGUMENT diagnostic

^KT-59416 Fixed
This commit is contained in:
Alexander Korepanov
2023-07-11 13:51:39 +02:00
committed by Space Team
parent 760320a11b
commit f6b7a07efe
10 changed files with 69 additions and 21 deletions
@@ -5144,6 +5144,13 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirJsErrors.EXTERNAL_INTERFACE_AS_REIFIED_TYPE_ARGUMENT) { firDiagnostic ->
ExternalInterfaceAsReifiedTypeArgumentImpl(
firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a),
firDiagnostic as KtPsiDiagnostic,
token,
)
}
add(FirJsErrors.NESTED_JS_EXPORT) { firDiagnostic ->
NestedJsExportImpl(
firDiagnostic as KtPsiDiagnostic,
@@ -3580,6 +3580,11 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
val argType: KtType
}
interface ExternalInterfaceAsReifiedTypeArgument : KtFirDiagnostic<KtElement> {
override val diagnosticClass get() = ExternalInterfaceAsReifiedTypeArgument::class
val typeArgument: KtType
}
interface NestedJsExport : KtFirDiagnostic<KtElement> {
override val diagnosticClass get() = NestedJsExport::class
}
@@ -4329,6 +4329,12 @@ internal class JsExternalArgumentImpl(
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtExpression>(firDiagnostic, token), KtFirDiagnostic.JsExternalArgument
internal class ExternalInterfaceAsReifiedTypeArgumentImpl(
override val typeArgument: KtType,
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtElement>(firDiagnostic, token), KtFirDiagnostic.ExternalInterfaceAsReifiedTypeArgument
internal class NestedJsExportImpl(
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,