@@ -137,14 +137,17 @@ abstract class Reporter extends interfaces.ReporterResult {
137
137
138
138
var unreportedWarnings : Map [String , Int ] = Map .empty
139
139
140
+ def addUnreported (key : String , n : Int ): Unit =
141
+ val count = unreportedWarnings.getOrElse(key, 0 )
142
+ unreportedWarnings = unreportedWarnings.updated(key, count + n)
143
+
140
144
/** Issue the diagnostic, ignoring `-Wconf` and `@nowarn` configurations,
141
145
* but still honouring `-nowarn`, `-Werror`, and conditional warnings. */
142
146
def issueUnconfigured (dia : Diagnostic )(using Context ): Unit = dia match
143
147
case w : Warning if ctx.settings.silentWarnings.value =>
144
148
case w : ConditionalWarning if w.isSummarizedConditional =>
145
149
val key = w.enablingOption.name
146
- val count = unreportedWarnings.getOrElse(key, 0 )
147
- unreportedWarnings = unreportedWarnings.updated(key, count + 1 )
150
+ addUnreported(key, 1 )
148
151
case _ =>
149
152
// conditional warnings that are not enabled are not fatal
150
153
val d = dia match
@@ -241,6 +244,8 @@ abstract class Reporter extends interfaces.ReporterResult {
241
244
def flush ()(using Context ): Unit =
242
245
val msgs = removeBufferedMessages
243
246
if msgs.nonEmpty then msgs.foreach(ctx.reporter.report)
247
+ for (key, count) <- unreportedWarnings do
248
+ ctx.reporter.addUnreported(key, count)
244
249
245
250
/** If this reporter buffers messages, all buffered messages, otherwise Nil */
246
251
def pendingMessages (using Context ): List [Diagnostic ] = Nil
0 commit comments