File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
compiler/src/dotty/tools/dotc/config Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ private sealed trait WarningSettings:
207207 def nowarn (using Context ) = allOr(" nowarn" )
208208
209209 // Is any choice set for -Wunused?
210- def any (using Context ): Boolean = Wunused .value.nonEmpty
210+ def any (using Context ): Boolean = Wall .value || Wunused .value.nonEmpty
211211
212212 // overrided by strict-no-implicit-warn
213213 def imports (using Context ) =
Original file line number Diff line number Diff line change 1+ -- [E198] Unused Symbol Warning: tests/warn/i18559c.scala:4:28 ---------------------------------------------------------
2+ 4 | import collection.mutable.Set // warn
3+ | ^^^
4+ | unused import
15-- [E198] Unused Symbol Warning: tests/warn/i18559c.scala:8:8 ----------------------------------------------------------
268 | val x = 1 // warn
37 | ^
48 | unused local definition
9+ -- [E198] Unused Symbol Warning: tests/warn/i18559c.scala:11:26 --------------------------------------------------------
10+ 11 | import SomeGivenImports.given // warn
11+ | ^^^^^
12+ | unused import
Original file line number Diff line number Diff line change 11//> using options -Wall -Wunused:locals
2- // This test checks that -Wall leaves -Wunused:... untouched if it is already set
2+ // This test checks that -Wall overrides -Wunused:... if it is already set
33object FooImportUnused :
4- import collection .mutable .Set // not warn
4+ import collection .mutable .Set // warn
55
66object FooUnusedLocal :
77 def test (): Unit =
88 val x = 1 // warn
99
1010object FooGivenUnused :
11- import SomeGivenImports .given // not warn
11+ import SomeGivenImports .given // warn
1212
1313object SomeGivenImports :
1414 given Int = 0
You can’t perform that action at this time.
0 commit comments