Skip to content

Commit

Permalink
Fix compiler crash in WUnused
Browse files Browse the repository at this point in the history
  • Loading branch information
szymon-rd authored and Kordyjan committed Apr 26, 2023
1 parent 40502e0 commit 72e5dd2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/transform/CheckUnused.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class CheckUnused private (phaseMode: CheckUnused.PhaseMode, suffix: String, _ke

override def isRunnable(using Context): Boolean =
ctx.settings.Wunused.value.nonEmpty &&
!ctx.isJava
!ctx.isJava &&
super.isRunnable

// ========== SETUP ============

Expand Down
4 changes: 4 additions & 0 deletions tests/neg-custom-args/fatal-warnings/i17335.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// scalac: -Wunused:all

def aMethod() =
doStuff { (x) => x } // error

0 comments on commit 72e5dd2

Please # to comment.