Skip to content

Commit 9874ae3

Browse files
szymon-rdKordyjan
authored andcommitted
Fix compiler crash in WUnused
1 parent 5990252 commit 9874ae3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ class CheckUnused private (phaseMode: CheckUnused.PhaseMode, suffix: String, _ke
4747

4848
override def isRunnable(using Context): Boolean =
4949
ctx.settings.Wunused.value.nonEmpty &&
50-
!ctx.isJava
50+
!ctx.isJava &&
51+
super.isRunnable
5152

5253
// ========== SETUP ============
5354

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// scalac: -Wunused:all
2+
3+
def aMethod() =
4+
doStuff { (x) => x } // error

0 commit comments

Comments
 (0)