[FIR] Revert FirMultipleDefaultsInheritedFromSupertypesChecker
It's possible to write a fix that would prevent false positives with this checker, but the core intuition behind it is invalid. This checker assumes that it's enough to only check direct overriddens, while in reality even simple `Source` override functions are not allowed to contain default values, so they can't be used to make judgements about them. ^KT-59408 Open ^KT-59408 Open ^KT-61095 Fixed ^KT-61165 Fixed ^KT-61029 Fixed
This commit is contained in:
committed by
Space Team
parent
2ce324f1fc
commit
dc9ed5656e
-14
@@ -2562,20 +2562,6 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES) { firDiagnostic ->
|
||||
MultipleDefaultsInheritedFromSupertypesImpl(
|
||||
firSymbolBuilder.buildSymbol(firDiagnostic.a),
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.MULTIPLE_DEFAULTS_INHERITED_FROM_SUPERTYPES_WHEN_NO_EXPLICIT_OVERRIDE) { firDiagnostic ->
|
||||
MultipleDefaultsInheritedFromSupertypesWhenNoExplicitOverrideImpl(
|
||||
firSymbolBuilder.buildSymbol(firDiagnostic.a),
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.TYPEALIAS_EXPANDS_TO_ARRAY_OF_NOTHINGS) { firDiagnostic ->
|
||||
TypealiasExpandsToArrayOfNothingsImpl(
|
||||
firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a),
|
||||
|
||||
-10
@@ -1821,16 +1821,6 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
val containingClassName: Name
|
||||
}
|
||||
|
||||
interface MultipleDefaultsInheritedFromSupertypes : KtFirDiagnostic<KtElement> {
|
||||
override val diagnosticClass get() = MultipleDefaultsInheritedFromSupertypes::class
|
||||
val valueParameter: KtSymbol
|
||||
}
|
||||
|
||||
interface MultipleDefaultsInheritedFromSupertypesWhenNoExplicitOverride : KtFirDiagnostic<KtElement> {
|
||||
override val diagnosticClass get() = MultipleDefaultsInheritedFromSupertypesWhenNoExplicitOverride::class
|
||||
val valueParameter: KtSymbol
|
||||
}
|
||||
|
||||
interface TypealiasExpandsToArrayOfNothings : KtFirDiagnostic<KtElement> {
|
||||
override val diagnosticClass get() = TypealiasExpandsToArrayOfNothings::class
|
||||
val type: KtType
|
||||
|
||||
-12
@@ -2187,18 +2187,6 @@ internal class CannotChangeAccessPrivilegeImpl(
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<KtModifierListOwner>(firDiagnostic, token), KtFirDiagnostic.CannotChangeAccessPrivilege
|
||||
|
||||
internal class MultipleDefaultsInheritedFromSupertypesImpl(
|
||||
override val valueParameter: KtSymbol,
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<KtElement>(firDiagnostic, token), KtFirDiagnostic.MultipleDefaultsInheritedFromSupertypes
|
||||
|
||||
internal class MultipleDefaultsInheritedFromSupertypesWhenNoExplicitOverrideImpl(
|
||||
override val valueParameter: KtSymbol,
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<KtElement>(firDiagnostic, token), KtFirDiagnostic.MultipleDefaultsInheritedFromSupertypesWhenNoExplicitOverride
|
||||
|
||||
internal class TypealiasExpandsToArrayOfNothingsImpl(
|
||||
override val type: KtType,
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
|
||||
Reference in New Issue
Block a user