Not sure if it is a bug or not. If yes, I’ll be glad to file it on GitHub.
According to scala-cli -S 3.7.nightly -O -W:
-WallEnable all warning settings.-WshadowEnable or disable specificshadowwarnings-WunusedEnable or disable specificunusedwarnings
The way I get it is that -Wall should imply both -Wshadow:all and -Wunused:all.
However for now it imlplies -Wunused only but not -Wshadow:
//> using scala 3.7.nightly
//> using options -Wshadow:all -Wunused:all
class A:
protected val x: String = ""
class B extends A:
private val x: Int = 0
produces the following output:
-- Warning: .../wall-wshadow-wunused.scala:8:2
8 | private val x: Int = 0
| ^
| value x in class B shadows field x inherited from class A
-- [E198] Unused Symbol Warning: .../wall-wshadow-wunused.scala:8:14
8 | private val x: Int = 0
| ^
| unused private member
2 warnings found
However if -Wshadow:all and -Wunused:all are replaced with -Wall:
//> using scala 3.7.nightly
//> using options -Wall
// --- the rest is the same as above ---
then only the “unused” warning is reported:
-- [E198] Unused Symbol Warning: .../wall-wshadow-wunused.scala:8:14
8 | private val x: Int = 0
| ^
| unused private member
1 warning found
It also works the same way with both the stable v3.7.4 and v3.8.nightly.