diff --git a/compiler/src/dotty/tools/dotc/reporting/ExploringReporter.scala b/compiler/src/dotty/tools/dotc/reporting/ExploringReporter.scala index f469c03764c0..99720b8e4d29 100644 --- a/compiler/src/dotty/tools/dotc/reporting/ExploringReporter.scala +++ b/compiler/src/dotty/tools/dotc/reporting/ExploringReporter.scala @@ -18,6 +18,9 @@ class ExploringReporter extends StoreReporter(null, fromTyperState = false): override def removeBufferedMessages(using Context): List[Diagnostic] = try infos.toList finally reset() + override def mapBufferedMessages(f: Diagnostic => Diagnostic)(using Context): Unit = + infos.mapInPlace(f) + def reset(): Unit = infos.clear() -end ExploringReporter \ No newline at end of file +end ExploringReporter diff --git a/compiler/src/dotty/tools/dotc/reporting/Reporter.scala b/compiler/src/dotty/tools/dotc/reporting/Reporter.scala index db63cd7a7ce4..84969a21acac 100644 --- a/compiler/src/dotty/tools/dotc/reporting/Reporter.scala +++ b/compiler/src/dotty/tools/dotc/reporting/Reporter.scala @@ -264,9 +264,7 @@ abstract class Reporter extends interfaces.ReporterResult { def removeBufferedMessages(using Context): List[Diagnostic] = Nil /** If this reporter buffers messages, apply `f` to all buffered messages. */ - def mapBufferedMessages(f: Diagnostic => Diagnostic)(using Context): Unit = - val mappedDiagnostics = removeBufferedMessages.map(f) - mappedDiagnostics.foreach(report) + def mapBufferedMessages(f: Diagnostic => Diagnostic)(using Context): Unit = () /** Issue all messages in this reporter to next outer one, or make sure they are written. */ def flush()(using Context): Unit = diff --git a/compiler/src/dotty/tools/dotc/reporting/StoreReporter.scala b/compiler/src/dotty/tools/dotc/reporting/StoreReporter.scala index 532aeab9d383..9395788d4cc7 100644 --- a/compiler/src/dotty/tools/dotc/reporting/StoreReporter.scala +++ b/compiler/src/dotty/tools/dotc/reporting/StoreReporter.scala @@ -37,6 +37,9 @@ class StoreReporter(outer: Reporter | Null = Reporter.NoReporter, fromTyperState if (infos != null) try infos.uncheckedNN.toList finally infos = null else Nil + override def mapBufferedMessages(f: Diagnostic => Diagnostic)(using Context): Unit = + if infos != null then infos.uncheckedNN.mapInPlace(f) + override def pendingMessages(using Context): List[Diagnostic] = if (infos != null) infos.uncheckedNN.toList else Nil diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index cb7f6cb9cf54..bac82e1deb8f 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -1097,6 +1097,7 @@ trait Applications extends Compatibility { case _ => dia case msg => dia case dia => dia + case _ => () // Try once with original prototype and once (if different) with tupled one. // The reason we need to try both is that the decision whether to use tupled