[FIR JS] Implement FirJsExportDeclarationChecker
This commit is contained in:
+22
@@ -4987,6 +4987,28 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirJsErrors.WRONG_EXPORTED_DECLARATION) { firDiagnostic ->
|
||||
WrongExportedDeclarationImpl(
|
||||
firDiagnostic.a,
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirJsErrors.NON_EXPORTABLE_TYPE) { firDiagnostic ->
|
||||
NonExportableTypeImpl(
|
||||
firDiagnostic.a,
|
||||
firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b),
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirJsErrors.NON_CONSUMABLE_EXPORTED_IDENTIFIER) { firDiagnostic ->
|
||||
NonConsumableExportedIdentifierImpl(
|
||||
firDiagnostic.a,
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirJsErrors.DELEGATION_BY_DYNAMIC) { firDiagnostic ->
|
||||
DelegationByDynamicImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
|
||||
+16
@@ -3466,6 +3466,22 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
override val diagnosticClass get() = NestedJsExport::class
|
||||
}
|
||||
|
||||
abstract class WrongExportedDeclaration : KtFirDiagnostic<KtElement>() {
|
||||
override val diagnosticClass get() = WrongExportedDeclaration::class
|
||||
abstract val kind: String
|
||||
}
|
||||
|
||||
abstract class NonExportableType : KtFirDiagnostic<KtElement>() {
|
||||
override val diagnosticClass get() = NonExportableType::class
|
||||
abstract val kind: String
|
||||
abstract val type: KtType
|
||||
}
|
||||
|
||||
abstract class NonConsumableExportedIdentifier : KtFirDiagnostic<KtElement>() {
|
||||
override val diagnosticClass get() = NonConsumableExportedIdentifier::class
|
||||
abstract val name: String
|
||||
}
|
||||
|
||||
abstract class DelegationByDynamic : KtFirDiagnostic<KtElement>() {
|
||||
override val diagnosticClass get() = DelegationByDynamic::class
|
||||
}
|
||||
|
||||
+19
@@ -4195,6 +4195,25 @@ internal class NestedJsExportImpl(
|
||||
override val token: KtLifetimeToken,
|
||||
) : KtFirDiagnostic.NestedJsExport(), KtAbstractFirDiagnostic<KtElement>
|
||||
|
||||
internal class WrongExportedDeclarationImpl(
|
||||
override val kind: String,
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: KtLifetimeToken,
|
||||
) : KtFirDiagnostic.WrongExportedDeclaration(), KtAbstractFirDiagnostic<KtElement>
|
||||
|
||||
internal class NonExportableTypeImpl(
|
||||
override val kind: String,
|
||||
override val type: KtType,
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: KtLifetimeToken,
|
||||
) : KtFirDiagnostic.NonExportableType(), KtAbstractFirDiagnostic<KtElement>
|
||||
|
||||
internal class NonConsumableExportedIdentifierImpl(
|
||||
override val name: String,
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: KtLifetimeToken,
|
||||
) : KtFirDiagnostic.NonConsumableExportedIdentifier(), KtAbstractFirDiagnostic<KtElement>
|
||||
|
||||
internal class DelegationByDynamicImpl(
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: KtLifetimeToken,
|
||||
|
||||
Reference in New Issue
Block a user