File tree 1 file changed +9
-1
lines changed
compiler/src/dotty/tools/dotc/reporting
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -244,15 +244,23 @@ abstract class Reporter extends interfaces.ReporterResult {
244
244
*/
245
245
def hasUnreportedErrors : Boolean = false
246
246
247
+ /** Does this reporter contain any message that have yet to be reported by its outer reporter ?
248
+ * This includes any warning stored in `unreportedWarnings` which need to be propagated to
249
+ * get an accurate count of unreported warnings in the outer reporter.
250
+ */
251
+ def hasUnreportedMessages (using Context ): Boolean =
252
+ pendingMessages.nonEmpty || unreportedWarnings.nonEmpty
253
+
247
254
/** If this reporter buffers messages, remove and return all buffered messages. */
248
255
def removeBufferedMessages (using Context ): List [Diagnostic ] = Nil
249
256
250
- /** Issue all error messages in this reporter to next outer one, or make sure they are written. */
257
+ /** Issue all messages in this reporter to next outer one, or make sure they are written. */
251
258
def flush ()(using Context ): Unit =
252
259
val msgs = removeBufferedMessages
253
260
if msgs.nonEmpty then msgs.foreach(ctx.reporter.report)
254
261
for (key, count) <- unreportedWarnings do
255
262
ctx.reporter.addUnreported(key, count)
263
+ unreportedWarnings = Map .empty
256
264
257
265
/** If this reporter buffers messages, all buffered messages, otherwise Nil */
258
266
def pendingMessages (using Context ): List [Diagnostic ] = Nil
You can’t perform that action at this time.
0 commit comments