Closed som-snytt closed 1 month ago
We should add documentation here https://github.com/scala/scala3/blob/3.5.0/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala#L251
(After running sbt:scala3> buildQuick
, why does bin/scalaQ -Wconf:help
only show "-Wconf Configure compiler warnings." and nothing else...?)
Looks good otherwise!
Also the summary counts 4
there were 4 deprecation warnings; re-run with -deprecation for details
1 warning found
but under -deprecation
➜ dotty git:(issue/17538-wconf-origin) ✗ ~/projects/dotty/bin/scalacQ -d /tmp/sandbox -deprecation tests/warn/deprecated-origin.scala
-- Deprecation Warning: tests/warn/deprecated-origin.scala:12:18 ---------------
12 | class D extends C // nowarn - C$ pattern avoids matching Crude
| ^
| class C in package p is deprecated since 1.0: Old style
-- Deprecation Warning: tests/warn/deprecated-origin.scala:13:20 ---------------
13 | class Oil extends Crude // warn
| ^^^^^
| class Crude in package p is deprecated since 1.0: Bad style
2 warnings found
It has taken me more than a few minutes on -Wconf:help
, which works on 3.5.0. (This week I upgraded WSL to Ubuntu 24, so among my updated mechanisms is cs, which gave me 3.5.0.) Obviously, it's unpleasant that there is no test; there are a couple of major changes this year. This is what switched from using description
to availableBlahBlah
(which is shortDescription
) https://github.com/scala/scala3/commit/f6345c6202b69a4603cb61ca029d60aa2ac80599
➜ dotty git:(issue/17538-wconf-origin) ✗ scalac -version
Scala compiler version 3.5.0 -- Copyright 2002-2024, LAMP/EPFL
➜ dotty git:(issue/17538-wconf-origin) ✗ scalac -Wconf:help
Configure compiler warnings.
Syntax: -Wconf:<filters>:<action>,<filters>:<action>,...
multiple <filters> are combined with &, i.e., <filter>&...&<filter>
<filter>
- Any message: any
- Message categories: cat=deprecation, cat=feature, cat=unchecked
I didn't add a -Wconf:help
test (the output doesn't show up under vulpix) and didn't look at the warning count issue.
The
origin
parameter todeprecationWarning
is optional; the parameter toDeprecationWarning
is not.The
origin
of a deprecation is simply the deprecated symbol. The full name is matched by the regex specified by-Wconf
.The other important use case is the
origin
of an unused element, in particular, the selector which causes an "unused import" warning. That use case will be supported in a follow-up PR, and should work as in Scala 2.Fixes #17538