summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2017-04-05 12:27:40 -0700
committerSom Snytt <som.snytt@gmail.com>2017-04-06 12:35:19 -0700
commit6614931197e788ffed2b8a6a959b9b5abfcc9142 (patch)
treeb8dcb92e14a050735eb8d8c887564f7913852dd8
parent47754ef531ec58bc11fe678b2b2aaab2cc20def9 (diff)
downloadscala-6614931197e788ffed2b8a6a959b9b5abfcc9142.tar.gz
scala-6614931197e788ffed2b8a6a959b9b5abfcc9142.tar.bz2
scala-6614931197e788ffed2b8a6a959b9b5abfcc9142.zip
SI-8040 Retreat on params
Don't warn unused params when `-Xlint`. Don't disable under lint, so `-Ywarn-unused -Xlint` works.
-rw-r--r--src/compiler/scala/tools/nsc/settings/Warnings.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/Warnings.scala b/src/compiler/scala/tools/nsc/settings/Warnings.scala
index eb78064155..54678a5c12 100644
--- a/src/compiler/scala/tools/nsc/settings/Warnings.scala
+++ b/src/compiler/scala/tools/nsc/settings/Warnings.scala
@@ -85,7 +85,7 @@ trait Warnings {
val UnsoundMatch = LintWarning("unsound-match", "Pattern match may not be typesafe.")
val StarsAlign = LintWarning("stars-align", "Pattern sequence wildcard must align with sequence component.")
val Constant = LintWarning("constant", "Evaluation of a constant arithmetic expression results in an error.")
- val Unused = LintWarning("unused", "Enable -Ywarn-unused:-patvars,_.")
+ val Unused = LintWarning("unused", "Enable -Ywarn-unused:imports,privates,locals,implicits.")
def allLintWarnings = values.toSeq.asInstanceOf[Seq[LintWarning]]
}
@@ -129,7 +129,10 @@ trait Warnings {
descr = "Enable or disable specific warnings",
domain = LintWarnings,
default = Some(List("_"))
- ).withPostSetHook { s => if (s contains Unused) List("-patvars","_").foreach(warnUnused.add) }
+ ).withPostSetHook { s =>
+ val unused = List("imports", "privates", "locals", "implicits")
+ if (s contains Unused) unused.foreach(warnUnused.add)
+ }
allLintWarnings foreach {
case w if w.yAliased =>