Skip to content

Commit 7a6dc76

Browse files
authored
Fix compiler crash in WUnused (#17340)
Fix #17335
2 parents a210f38 + 8cbde30 commit 7a6dc76

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)