@@ -8,7 +8,8 @@ import dotty.tools.dotc.core.Contexts.*
8
8
import dotty .tools .dotc .core .Flags .*
9
9
import dotty .tools .dotc .core .Names .{Name , SimpleName , DerivedName , TermName , termName }
10
10
import dotty .tools .dotc .core .NameOps .{isAnonymousFunctionName , isReplWrapperName }
11
- import dotty .tools .dotc .core .NameKinds .{BodyRetainerName , ContextBoundParamName , ContextFunctionParamName , WildcardParamName }
11
+ import dotty .tools .dotc .core .NameKinds .{
12
+ BodyRetainerName , ContextBoundParamName , ContextFunctionParamName , DefaultGetterName , WildcardParamName }
12
13
import dotty .tools .dotc .core .StdNames .nme
13
14
import dotty .tools .dotc .core .Symbols .{ClassSymbol , NoSymbol , Symbol , defn , isDeprecated , requiredClass , requiredModule }
14
15
import dotty .tools .dotc .core .Types .*
@@ -170,7 +171,8 @@ class CheckUnused private (phaseMode: PhaseMode, suffix: String) extends MiniPha
170
171
override def prepareForDefDef (tree : DefDef )(using Context ): Context =
171
172
def trivial = tree.symbol.is(Deferred ) || isUnconsuming(tree.rhs)
172
173
def nontrivial = tree.symbol.isConstructor || tree.symbol.isAnonymousFunction
173
- if ! nontrivial && trivial then refInfos.skip.addOne(tree.symbol)
174
+ def isDefault = tree.symbol.name.is(DefaultGetterName )
175
+ if ! nontrivial && trivial || isDefault then refInfos.skip.addOne(tree.symbol)
174
176
if tree.symbol.is(Inline ) then
175
177
refInfos.inliners += 1
176
178
else if ! tree.symbol.is(Deferred ) && tree.rhs.symbol != defn.Predef_undefined then
0 commit comments