From 6614931197e788ffed2b8a6a959b9b5abfcc9142 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Wed, 5 Apr 2017 12:27:40 -0700 Subject: SI-8040 Retreat on params Don't warn unused params when `-Xlint`. Don't disable under lint, so `-Ywarn-unused -Xlint` works. --- src/compiler/scala/tools/nsc/settings/Warnings.scala | 7 +++++-- 1 file 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 => -- cgit v1.2.3