File tree 1 file changed +5
-3
lines changed
compiler/src/dotty/tools/dotc/transform
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -590,7 +590,7 @@ object CheckUnused:
590
590
end checkExplicit
591
591
// begin
592
592
if ! infos.skip(m)
593
- && ! m.nextOverriddenSymbol.exists
593
+ && ! m.isEffectivelyOverride
594
594
&& ! allowed
595
595
then
596
596
checkExplicit()
@@ -614,7 +614,7 @@ object CheckUnused:
614
614
|| sym.info.isInstanceOf [RefinedType ] // can't be expressed as a context bound
615
615
if ctx.settings.WunusedHas .implicits
616
616
&& ! infos.skip(m)
617
- && ! m.nextOverriddenSymbol.exists
617
+ && ! m.isEffectivelyOverride
618
618
&& ! allowed
619
619
then
620
620
if m.isPrimaryConstructor then
@@ -924,7 +924,9 @@ object CheckUnused:
924
924
! m.isTerm || m.isSelfSym || m.is(Method ) && (m.owner == defn.AnyClass || m.owner == defn.ObjectClass )
925
925
def isEffectivelyPrivate (using Context ): Boolean =
926
926
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
928
930
// pick the symbol the user wrote for purposes of tracking
929
931
inline def userSymbol (using Context ): Symbol =
930
932
if sym.denot.is(ModuleClass ) then sym.denot.companionModule else sym
You can’t perform that action at this time.
0 commit comments