File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -590,7 +590,7 @@ object CheckUnused:
590590 end checkExplicit
591591 // begin
592592 if ! infos.skip(m)
593- && ! m.nextOverriddenSymbol.exists
593+ && ! m.isEffectivelyOverride
594594 && ! allowed
595595 then
596596 checkExplicit()
@@ -614,7 +614,7 @@ object CheckUnused:
614614 || sym.info.isInstanceOf [RefinedType ] // can't be expressed as a context bound
615615 if ctx.settings.WunusedHas .implicits
616616 && ! infos.skip(m)
617- && ! m.nextOverriddenSymbol.exists
617+ && ! m.isEffectivelyOverride
618618 && ! allowed
619619 then
620620 if m.isPrimaryConstructor then
@@ -924,7 +924,9 @@ object CheckUnused:
924924 ! m.isTerm || m.isSelfSym || m.is(Method ) && (m.owner == defn.AnyClass || m.owner == defn.ObjectClass )
925925 def isEffectivelyPrivate (using Context ): Boolean =
926926 sym.is(Private , butNot = ParamAccessor )
927- || sym.owner.isAnonymousClass && ! sym.is(Override ) && ! sym.nextOverriddenSymbol.exists
927+ || sym.owner.isAnonymousClass && ! sym.isEffectivelyOverride
928+ def isEffectivelyOverride (using Context ): Boolean =
929+ sym.is(Override ) || sym.nextOverriddenSymbol.exists
928930 // pick the symbol the user wrote for purposes of tracking
929931 inline def userSymbol (using Context ): Symbol =
930932 if sym.denot.is(ModuleClass ) then sym.denot.companionModule else sym
You can’t perform that action at this time.
0 commit comments