@@ -197,12 +197,15 @@ class CheckUnused extends MiniPhase:
197197 case t: tpd.ValDef =>
198198 prepareForValDef(t)
199199 traverseChildren(tree)(using newCtx)
200+ transformValDef(t)
200201 case t: tpd.DefDef =>
201202 prepareForDefDef(t)
202203 traverseChildren(tree)(using newCtx)
204+ transformDefDef(t)
203205 case t: tpd.TypeDef =>
204206 prepareForTypeDef(t)
205207 traverseChildren(tree)(using newCtx)
208+ transformTypeDef(t)
206209 case t : tpd.Bind =>
207210 prepareForBind(t)
208211 traverseChildren(tree)(using newCtx)
@@ -325,7 +328,7 @@ object CheckUnused:
325328 * The optional name will be used to target the right import
326329 * as the same element can be imported with different renaming
327330 */
328- def registerUsed (sym : Symbol , name : Option [Name ])(using Context ): Unit =
331+ def registerUsed (sym : Symbol , name : Option [Name ])(using Context ): Unit =
329332 if ! isConstructorOfSynth(sym) && ! doNotRegister(sym) then
330333 if sym.isConstructor && sym.exists then
331334 registerUsed(sym.owner, None ) // constructor are "implicitly" imported with the class
@@ -365,7 +368,7 @@ object CheckUnused:
365368 implicitParamInScope += memDef
366369 else
367370 explicitParamInScope += memDef
368- else if currScopeType.top == ScopeType .Local then
371+ else if currScopeType.top == ScopeType .Local then
369372 localDefInScope += memDef
370373 else if currScopeType.top == ScopeType .Template && memDef.symbol.is(Private , butNot = SelfName ) then
371374 privateDefInScope += memDef
0 commit comments