@@ -8,7 +8,8 @@ import dotty.tools.dotc.core.Contexts.*
88import dotty .tools .dotc .core .Flags .*
99import dotty .tools .dotc .core .Names .{Name , SimpleName , DerivedName , TermName , termName }
1010import dotty .tools .dotc .core .NameOps .{isAnonymousFunctionName , isReplWrapperName , isContextFunction }
11- import dotty .tools .dotc .core .NameKinds .{BodyRetainerName , ContextBoundParamName , ContextFunctionParamName , WildcardParamName }
11+ import dotty .tools .dotc .core .NameKinds .{
12+ BodyRetainerName , ContextBoundParamName , ContextFunctionParamName , DefaultGetterName , WildcardParamName }
1213import dotty .tools .dotc .core .StdNames .nme
1314import dotty .tools .dotc .core .Symbols .{ClassSymbol , NoSymbol , Symbol , defn , isDeprecated , requiredClass , requiredModule }
1415import dotty .tools .dotc .core .Types .*
@@ -173,7 +174,8 @@ class CheckUnused private (phaseMode: PhaseMode, suffix: String) extends MiniPha
173174 override def prepareForDefDef (tree : DefDef )(using Context ): Context =
174175 def trivial = tree.symbol.is(Deferred ) || isUnconsuming(tree.rhs)
175176 def nontrivial = tree.symbol.isConstructor || tree.symbol.isAnonymousFunction
176- if ! nontrivial && trivial then
177+ def isDefault = tree.symbol.name.is(DefaultGetterName )
178+ if ! nontrivial && trivial || isDefault then
177179 refInfos.skip.addOne(tree.symbol)
178180 if tree.symbol.is(Inline ) then
179181 refInfos.inliners += 1
0 commit comments