@@ -197,12 +197,15 @@ class CheckUnused extends MiniPhase:
197
197
case t: tpd.ValDef =>
198
198
prepareForValDef(t)
199
199
traverseChildren(tree)(using newCtx)
200
+ transformValDef(t)
200
201
case t: tpd.DefDef =>
201
202
prepareForDefDef(t)
202
203
traverseChildren(tree)(using newCtx)
204
+ transformDefDef(t)
203
205
case t: tpd.TypeDef =>
204
206
prepareForTypeDef(t)
205
207
traverseChildren(tree)(using newCtx)
208
+ transformTypeDef(t)
206
209
case t : tpd.Bind =>
207
210
prepareForBind(t)
208
211
traverseChildren(tree)(using newCtx)
@@ -325,7 +328,7 @@ object CheckUnused:
325
328
* The optional name will be used to target the right import
326
329
* as the same element can be imported with different renaming
327
330
*/
328
- def registerUsed (sym : Symbol , name : Option [Name ])(using Context ): Unit =
331
+ def registerUsed (sym : Symbol , name : Option [Name ])(using Context ): Unit =
329
332
if ! isConstructorOfSynth(sym) && ! doNotRegister(sym) then
330
333
if sym.isConstructor && sym.exists then
331
334
registerUsed(sym.owner, None ) // constructor are "implicitly" imported with the class
@@ -365,7 +368,7 @@ object CheckUnused:
365
368
implicitParamInScope += memDef
366
369
else
367
370
explicitParamInScope += memDef
368
- else if currScopeType.top == ScopeType .Local then
371
+ else if currScopeType.top == ScopeType .Local then
369
372
localDefInScope += memDef
370
373
else if currScopeType.top == ScopeType .Template && memDef.symbol.is(Private , butNot = SelfName ) then
371
374
privateDefInScope += memDef
0 commit comments