Skip to content

Commit a02ca5a

Browse files
som-snytttgodzik
authored andcommitted
Exclude synthetic opaque proxy from lint (scala#24264)
Fixes scala#24263 [Cherry-picked 55f235c]
1 parent c00e85a commit a02ca5a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ object CheckUnused:
669669

670670
def checkLocal(sym: Symbol, pos: SrcPos) =
671671
if ctx.settings.WunusedHas.locals
672-
&& !sym.is(InlineProxy)
672+
&& !sym.isOneOf(InlineProxy | Synthetic)
673673
then
674674
if sym.is(Mutable) && infos.asss(sym) then
675675
warnAt(pos)(UnusedSymbol.localVars)

tests/warn/i24263.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//> using options -Werror -Wunused:all
2+
3+
object test {
4+
def f(t: Tuple): Nothing = ???
5+
val _ = (inputTuple: NamedTuple.NamedTuple[Tuple, Tuple]) => f(inputTuple)
6+
}

0 commit comments

Comments
 (0)