Skip to content

Commit 55f235c

Browse files
authored
Exclude synthetic opaque proxy from lint (#24264)
Fixes #24263
1 parent 1c9d27a commit 55f235c

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
@@ -697,7 +697,7 @@ object CheckUnused:
697697

698698
def checkLocal(sym: Symbol, pos: SrcPos) =
699699
if ctx.settings.WunusedHas.locals
700-
&& !sym.is(InlineProxy)
700+
&& !sym.isOneOf(InlineProxy | Synthetic)
701701
then
702702
if sym.is(Mutable) && infos.asss(sym) then
703703
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)