[FIR] Add JVM diagnostics about external declaration
This commit is contained in:
committed by
TeamCityServer
parent
4907bc296f
commit
816e8f487c
+24
@@ -3756,4 +3756,28 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirJvmErrors.EXTERNAL_DECLARATION_CANNOT_BE_ABSTRACT) { firDiagnostic ->
|
||||
ExternalDeclarationCannotBeAbstractImpl(
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirJvmErrors.EXTERNAL_DECLARATION_CANNOT_HAVE_BODY) { firDiagnostic ->
|
||||
ExternalDeclarationCannotHaveBodyImpl(
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirJvmErrors.EXTERNAL_DECLARATION_IN_INTERFACE) { firDiagnostic ->
|
||||
ExternalDeclarationInInterfaceImpl(
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirJvmErrors.EXTERNAL_DECLARATION_CANNOT_BE_INLINED) { firDiagnostic ->
|
||||
ExternalDeclarationCannotBeInlinedImpl(
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -2612,4 +2612,20 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
override val diagnosticClass get() = NonJvmDefaultOverridesJavaDefault::class
|
||||
}
|
||||
|
||||
abstract class ExternalDeclarationCannotBeAbstract : KtFirDiagnostic<KtDeclaration>() {
|
||||
override val diagnosticClass get() = ExternalDeclarationCannotBeAbstract::class
|
||||
}
|
||||
|
||||
abstract class ExternalDeclarationCannotHaveBody : KtFirDiagnostic<KtDeclaration>() {
|
||||
override val diagnosticClass get() = ExternalDeclarationCannotHaveBody::class
|
||||
}
|
||||
|
||||
abstract class ExternalDeclarationInInterface : KtFirDiagnostic<KtDeclaration>() {
|
||||
override val diagnosticClass get() = ExternalDeclarationInInterface::class
|
||||
}
|
||||
|
||||
abstract class ExternalDeclarationCannotBeInlined : KtFirDiagnostic<KtDeclaration>() {
|
||||
override val diagnosticClass get() = ExternalDeclarationCannotBeInlined::class
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+28
@@ -4245,3 +4245,31 @@ internal class NonJvmDefaultOverridesJavaDefaultImpl(
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
internal class ExternalDeclarationCannotBeAbstractImpl(
|
||||
firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.ExternalDeclarationCannotBeAbstract(), KtAbstractFirDiagnostic<KtDeclaration> {
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
internal class ExternalDeclarationCannotHaveBodyImpl(
|
||||
firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.ExternalDeclarationCannotHaveBody(), KtAbstractFirDiagnostic<KtDeclaration> {
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
internal class ExternalDeclarationInInterfaceImpl(
|
||||
firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.ExternalDeclarationInInterface(), KtAbstractFirDiagnostic<KtDeclaration> {
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
internal class ExternalDeclarationCannotBeInlinedImpl(
|
||||
firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.ExternalDeclarationCannotBeInlined(), KtAbstractFirDiagnostic<KtDeclaration> {
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user