diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-02-17 17:31:28 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-02-17 19:16:01 +0100 |
commit | 1b1461fed759c8f937c01fe2e7d3922ab67df700 (patch) | |
tree | b4497e2eeb3dfad222b6860c4ad737b7fd956efb /src/compiler/scala/tools/nsc/settings/Warnings.scala | |
parent | 6152e9c3153a9c028066abf6b91f6bf105eacdfe (diff) | |
download | scala-1b1461fed759c8f937c01fe2e7d3922ab67df700.tar.gz scala-1b1461fed759c8f937c01fe2e7d3922ab67df700.tar.bz2 scala-1b1461fed759c8f937c01fe2e7d3922ab67df700.zip |
SI-7707 SI-7712 Exclude unused warnings from -Xlint
Experience building open source projects like Specs that use
`-Xlint` suggests that this warning is too noisy to lump in
with the others.
We are lacking in more fine-grained control of these things, so
simply turning of `-Xlint` in favour of its underlying `-Y` options
ends up *losing* some other important warnings that are predicated
directly on `-Xlint`.
Furthermore, bug reports against M8, SI-7707 SI-7712, show that
unused private/local warnings, while far less noisy, are still
in need of polish.
This commit moves these warnings to a pair of new -Y options,
neither of which is part of `-Xlint`..
Let's ask people to opt in for 2.11, and as it stabilizes, we can
consider adding it to Xlint (or the desirable evolution of that)
in the next release.
Diffstat (limited to 'src/compiler/scala/tools/nsc/settings/Warnings.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/settings/Warnings.scala | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/Warnings.scala b/src/compiler/scala/tools/nsc/settings/Warnings.scala index 791d44153c..5214f6485f 100644 --- a/src/compiler/scala/tools/nsc/settings/Warnings.scala +++ b/src/compiler/scala/tools/nsc/settings/Warnings.scala @@ -30,6 +30,8 @@ trait Warnings { warnNullaryUnit, warnAdaptedArgs, warnInferAny + // warnUnused SI-7712, SI-7707 warnUnused not quite ready for prime-time + // warnUnusedImport currently considered too noisy for general use ) // Warning groups. @@ -56,6 +58,8 @@ trait Warnings { val warnInaccessible = BooleanSetting ("-Ywarn-inaccessible", "Warn about inaccessible types in method signatures.") val warnNullaryOverride = BooleanSetting ("-Ywarn-nullary-override", "Warn when non-nullary overrides nullary, e.g. `def foo()` over `def foo`.") val warnInferAny = BooleanSetting ("-Ywarn-infer-any", "Warn when a type argument is inferred to be `Any`.") + val warnUnused = BooleanSetting ("-Ywarn-unused", "Warn when local and private vals, vars, defs, and types are are unused") + val warnUnusedImport = BooleanSetting ("-Ywarn-unused-import", "Warn when imports are unused") // Backward compatibility. @deprecated("Use fatalWarnings", "2.11.0") def Xwarnfatal = fatalWarnings // used by sbt |