Skip to content

Commit ea632db

Browse files
Backport "Exclude synthetic opaque proxy from lint" to 3.7.4 (#24287)
Backports #24264 to the 3.7.4. PR submitted by the release tooling.
2 parents 004eb67 + 0f1e1c7 commit ea632db

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
@@ -642,7 +642,7 @@ object CheckUnused:
642642

643643
def checkLocal(sym: Symbol, pos: SrcPos) =
644644
if ctx.settings.WunusedHas.locals
645-
&& !sym.is(InlineProxy)
645+
&& !sym.isOneOf(InlineProxy | Synthetic)
646646
&& !sym.isCanEqual
647647
then
648648
if sym.is(Mutable) && infos.asss(sym) then

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)