Skip to content

Commit

Permalink
No warn inline proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
som-snytt committed Jan 7, 2025
1 parent 92b5d74 commit 869ef7a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/transform/CheckUnused.scala
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ object CheckUnused:
warnAt(pos)(UnusedSymbol.implicitParams)
else if sym.isLocalToBlock then
if ctx.settings.WunusedHas.locals
&& !sym.is(InlineProxy)
&& !sym.isCanEqual
then
warnAt(pos)(UnusedSymbol.localDefs)
Expand Down
10 changes: 10 additions & 0 deletions tests/warn/i17753.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//> using options -Wunused:all

class PartiallyApplied[A] {
transparent inline def func[B](): Nothing = ???
}

def call[A] = new PartiallyApplied[A]

def good = call[Int].func[String]() // no warn inline proxy
def bad = { call[Int].func[String]() } // no warn inline proxy

0 comments on commit 869ef7a

Please sign in to comment.