Skip to content

Commit 20e8412

Browse files
szymon-rdKordyjan
authored andcommitted
Skip all symbols with $ in name in Wunused
1 parent 6424278 commit 20e8412

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

compiler/src/dotty/tools/dotc/transform/CheckUnused.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ object CheckUnused:
471471
if ctx.settings.WunusedHas.implicits then
472472
implicitParamInScope
473473
.filterNot(d => d.symbol.usedDefContains)
474-
.filterNot(d => containsSyntheticSuffix(d.symbol) && (!d.rawMods.is(Given) || hasZeroLengthSpan(d.symbol)))
474+
.filterNot(d => containsSyntheticSuffix(d.symbol))
475475
.map(d => d.namePos -> WarnTypes.ImplicitParams).toList
476476
else
477477
Nil
@@ -519,11 +519,6 @@ object CheckUnused:
519519
private def containsSyntheticSuffix(symbol: Symbol)(using Context): Boolean =
520520
symbol.name.mangledString.contains("$")
521521

522-
/**
523-
* Heuristic to detect generated symbols by checking if symbol has zero length span in source
524-
*/
525-
private def hasZeroLengthSpan(symbol: Symbol)(using Context): Boolean =
526-
symbol.span.end - symbol.span.start == 0
527522
/**
528523
* Is the the constructor of synthetic package object
529524
* Should be ignored as it is always imported/used in package

0 commit comments

Comments
 (0)