[FIR] Implement DEFAULT_VALUE_NOT_ALLOWED_IN_OVERRIDE diagnostic

#KT-59409 Fixed
This commit is contained in:
Kirill Rakhman
2023-07-21 17:06:42 +02:00
committed by Space Team
parent d93ffe0aec
commit 53ff4584d4
12 changed files with 47 additions and 51 deletions
@@ -2868,6 +2868,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirErrors.DEFAULT_VALUE_NOT_ALLOWED_IN_OVERRIDE) { firDiagnostic ->
DefaultValueNotAllowedInOverrideImpl(
firDiagnostic as KtPsiDiagnostic,
token,
)
}
add(FirErrors.FUN_INTERFACE_CONSTRUCTOR_REFERENCE) { firDiagnostic ->
FunInterfaceConstructorReferenceImpl(
firDiagnostic as KtPsiDiagnostic,
@@ -2032,6 +2032,10 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
override val diagnosticClass get() = DataObjectCustomEqualsOrHashCode::class
}
interface DefaultValueNotAllowedInOverride : KtFirDiagnostic<KtElement> {
override val diagnosticClass get() = DefaultValueNotAllowedInOverride::class
}
interface FunInterfaceConstructorReference : KtFirDiagnostic<KtExpression> {
override val diagnosticClass get() = FunInterfaceConstructorReference::class
}
@@ -2439,6 +2439,11 @@ internal class DataObjectCustomEqualsOrHashCodeImpl(
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtNamedFunction>(firDiagnostic, token), KtFirDiagnostic.DataObjectCustomEqualsOrHashCode
internal class DefaultValueNotAllowedInOverrideImpl(
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtElement>(firDiagnostic, token), KtFirDiagnostic.DefaultValueNotAllowedInOverride
internal class FunInterfaceConstructorReferenceImpl(
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,