diff options
author | Som Snytt <som.snytt@gmail.com> | 2014-09-01 17:20:46 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2014-09-01 17:20:46 -0700 |
commit | 6076d61aef732b89af9d2c803425f90fb0fc4686 (patch) | |
tree | 8e0e4d5edbc9395fbd0851e2cfef4d56d5ca1193 /src/compiler | |
parent | 7f21475c56b143f54491fb88041899366a281ee7 (diff) | |
download | scala-6076d61aef732b89af9d2c803425f90fb0fc4686.tar.gz scala-6076d61aef732b89af9d2c803425f90fb0fc4686.tar.bz2 scala-6076d61aef732b89af9d2c803425f90fb0fc4686.zip |
SI-8410 Summarize if warnings and not disabled
Simplify the conditional and emit the summary if
there were buffered warnings and the user didn't
explicitly disable this setting.
The working assumption is that using fatal-warnings
to turn on summaries was either an outdated heuristic
or just due to a faulty merge. Or wait, was it for
-feature, which is not enabled when warnings are
issued against it?
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/Reporting.scala | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/Reporting.scala b/src/compiler/scala/tools/nsc/Reporting.scala index 6ae5ec3c1d..c9782de7c8 100644 --- a/src/compiler/scala/tools/nsc/Reporting.scala +++ b/src/compiler/scala/tools/nsc/Reporting.scala @@ -32,17 +32,14 @@ trait Reporting extends scala.reflect.internal.Reporting { self: ast.Positions w def warn(pos: Position, msg: String) = if (option) reporter.warning(pos, msg) else if (!(warnings contains pos)) warnings += ((pos, msg)) - def summarize() = { - def turnedOff = option.isSetByUser && !option - def moreInfos = option.isDefault || settings.fatalWarnings - if (warnings.nonEmpty && !turnedOff && moreInfos) { + def summarize() = + if (warnings.nonEmpty && (option.isDefault || option)) { val numWarnings = warnings.size val warningVerb = if (numWarnings == 1) "was" else "were" val warningCount = countElementsAsString(numWarnings, s"$what warning") reporter.warning(NoPosition, s"there $warningVerb $warningCount; re-run with ${option.name} for details") } - } } // This change broke sbt; I gave it the thrilling name of uncheckedWarnings0 so |