[FIR JS] Support NON_EXTERNAL_DECLARATION_IN_INAPPROPRIATE_FILE

This commit is contained in:
Nikolay Lunyak
2023-01-04 16:50:15 +02:00
committed by Space Team
parent 5b3a73f7cd
commit 85bcef537c
14 changed files with 80 additions and 19 deletions
@@ -4829,6 +4829,13 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirJsErrors.NON_EXTERNAL_DECLARATION_IN_INAPPROPRIATE_FILE) { firDiagnostic ->
NonExternalDeclarationInInappropriateFileImpl(
firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a),
firDiagnostic as KtPsiDiagnostic,
token,
)
}
add(FirJsErrors.DELEGATION_BY_DYNAMIC) { firDiagnostic ->
DelegationByDynamicImpl(
firDiagnostic as KtPsiDiagnostic,
@@ -3356,6 +3356,11 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
override val diagnosticClass get() = NonAbstractMemberOfExternalInterface::class
}
abstract class NonExternalDeclarationInInappropriateFile : KtFirDiagnostic<KtElement>() {
override val diagnosticClass get() = NonExternalDeclarationInInappropriateFile::class
abstract val type: KtType
}
abstract class DelegationByDynamic : KtFirDiagnostic<KtElement>() {
override val diagnosticClass get() = DelegationByDynamic::class
}
@@ -4063,6 +4063,12 @@ internal class NonAbstractMemberOfExternalInterfaceImpl(
override val token: KtLifetimeToken,
) : KtFirDiagnostic.NonAbstractMemberOfExternalInterface(), KtAbstractFirDiagnostic<KtExpression>
internal class NonExternalDeclarationInInappropriateFileImpl(
override val type: KtType,
override val firDiagnostic: KtPsiDiagnostic,
override val token: KtLifetimeToken,
) : KtFirDiagnostic.NonExternalDeclarationInInappropriateFile(), KtAbstractFirDiagnostic<KtElement>
internal class DelegationByDynamicImpl(
override val firDiagnostic: KtPsiDiagnostic,
override val token: KtLifetimeToken,