File tree 3 files changed +12
-4
lines changed
compiler/src/dotty/tools/dotc/config
3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ private sealed trait WarningSettings:
203
203
def nowarn (using Context ) = allOr(" nowarn" )
204
204
205
205
// Is any choice set for -Wunused?
206
- def any (using Context ): Boolean = Wunused .value.nonEmpty
206
+ def any (using Context ): Boolean = Wall .value || Wunused .value.nonEmpty
207
207
208
208
// overrided by strict-no-implicit-warn
209
209
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
1
5
-- [E198] Unused Symbol Warning: tests/warn/i18559c.scala:8:8 ----------------------------------------------------------
2
6
8 | val x = 1 // warn
3
7
| ^
4
8
| 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 1
1
//> 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
3
3
object FooImportUnused :
4
- import collection .mutable .Set // not warn
4
+ import collection .mutable .Set // warn
5
5
6
6
object FooUnusedLocal :
7
7
def test (): Unit =
8
8
val x = 1 // warn
9
9
10
10
object FooGivenUnused :
11
- import SomeGivenImports .given // not warn
11
+ import SomeGivenImports .given // warn
12
12
13
13
object SomeGivenImports :
14
14
given Int = 0
You can’t perform that action at this time.
0 commit comments