Skip to content

Commit a784926

Browse files
authored
Backport "Fix compiler crash in WUnused" (#17356)
Backports #17340
2 parents 40502e0 + 46d9c07 commit a784926

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class CheckUnused private (phaseMode: CheckUnused.PhaseMode, suffix: String, _ke
4646
override def description: String = CheckUnused.description
4747

4848
override def isRunnable(using Context): Boolean =
49+
super.isRunnable &&
4950
ctx.settings.Wunused.value.nonEmpty &&
5051
!ctx.isJava
5152

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)