Skip to content

Commit 6076d61

Browse files
committed
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?
1 parent 7f21475 commit 6076d61

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/compiler/scala/tools/nsc/Reporting.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,14 @@ trait Reporting extends scala.reflect.internal.Reporting { self: ast.Positions w
3232
def warn(pos: Position, msg: String) =
3333
if (option) reporter.warning(pos, msg)
3434
else if (!(warnings contains pos)) warnings += ((pos, msg))
35-
def summarize() = {
36-
def turnedOff = option.isSetByUser && !option
37-
def moreInfos = option.isDefault || settings.fatalWarnings
38-
if (warnings.nonEmpty && !turnedOff && moreInfos) {
35+
def summarize() =
36+
if (warnings.nonEmpty && (option.isDefault || option)) {
3937
val numWarnings = warnings.size
4038
val warningVerb = if (numWarnings == 1) "was" else "were"
4139
val warningCount = countElementsAsString(numWarnings, s"$what warning")
4240

4341
reporter.warning(NoPosition, s"there $warningVerb $warningCount; re-run with ${option.name} for details")
4442
}
45-
}
4643
}
4744

4845
// This change broke sbt; I gave it the thrilling name of uncheckedWarnings0 so

0 commit comments

Comments
 (0)