[FIR] Report warning when error is suppressed
#KT-61129
This commit is contained in:
committed by
Space Team
parent
769e4ac0ac
commit
c32a0a83f9
+7
@@ -271,6 +271,13 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.ERROR_SUPPRESSION) { firDiagnostic ->
|
||||
ErrorSuppressionImpl(
|
||||
firDiagnostic.a,
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.INVISIBLE_REFERENCE) { firDiagnostic ->
|
||||
InvisibleReferenceImpl(
|
||||
firSymbolBuilder.buildSymbol(firDiagnostic.a),
|
||||
|
||||
+5
@@ -232,6 +232,11 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
override val diagnosticClass get() = InnerOnTopLevelScriptClassWarning::class
|
||||
}
|
||||
|
||||
interface ErrorSuppression : KtFirDiagnostic<PsiElement> {
|
||||
override val diagnosticClass get() = ErrorSuppression::class
|
||||
val diagnosticName: String
|
||||
}
|
||||
|
||||
interface InvisibleReference : KtFirDiagnostic<PsiElement> {
|
||||
override val diagnosticClass get() = InvisibleReference::class
|
||||
val reference: KtSymbol
|
||||
|
||||
+6
@@ -264,6 +264,12 @@ internal class InnerOnTopLevelScriptClassWarningImpl(
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.InnerOnTopLevelScriptClassWarning
|
||||
|
||||
internal class ErrorSuppressionImpl(
|
||||
override val diagnosticName: String,
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.ErrorSuppression
|
||||
|
||||
internal class InvisibleReferenceImpl(
|
||||
override val reference: KtSymbol,
|
||||
override val visible: Visibility,
|
||||
|
||||
Reference in New Issue
Block a user