aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/reporting/ConsoleReporter.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-12-17 15:04:05 +0100
committerMartin Odersky <odersky@gmail.com>2014-12-17 15:04:05 +0100
commit329b639970194128136cb54f2a8aa9c0e35fc2bc (patch)
tree482da6d44e8a864c5120fced42f6c3be14d612dd /src/dotty/tools/dotc/reporting/ConsoleReporter.scala
parent215be8b1c8c790cbab9260b2d4bb1f6873cbf7d0 (diff)
downloaddotty-329b639970194128136cb54f2a8aa9c0e35fc2bc.tar.gz
dotty-329b639970194128136cb54f2a8aa9c0e35fc2bc.tar.bz2
dotty-329b639970194128136cb54f2a8aa9c0e35fc2bc.zip
Move isSuppressed check from Reporter to ConsoleReporter.
isSuppressed forces computation of the error message; should be called only when emitting the error. TODO: Generalize so that other emitting reporters inherit the behavior.
Diffstat (limited to 'src/dotty/tools/dotc/reporting/ConsoleReporter.scala')
-rw-r--r--src/dotty/tools/dotc/reporting/ConsoleReporter.scala21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/dotty/tools/dotc/reporting/ConsoleReporter.scala b/src/dotty/tools/dotc/reporting/ConsoleReporter.scala
index 6991cdbb6..a7f7f70bb 100644
--- a/src/dotty/tools/dotc/reporting/ConsoleReporter.scala
+++ b/src/dotty/tools/dotc/reporting/ConsoleReporter.scala
@@ -40,16 +40,17 @@ class ConsoleReporter(
}
}
- override def doReport(d: Diagnostic)(implicit ctx: Context): Unit = d match {
- case d: Error =>
- printMessageAndPos(s"error: ${d.msg}", d.pos)
- if (ctx.settings.prompt.value) displayPrompt()
- case d: ConditionalWarning if !d.enablingOption.value =>
- case d: Warning =>
- printMessageAndPos(s"warning: ${d.msg}", d.pos)
- case _ =>
- printMessageAndPos(d.msg, d.pos)
- }
+ override def doReport(d: Diagnostic)(implicit ctx: Context): Unit =
+ if (!d.isSuppressed) d match {
+ case d: Error =>
+ printMessageAndPos(s"error: ${d.msg}", d.pos)
+ if (ctx.settings.prompt.value) displayPrompt()
+ case d: ConditionalWarning if !d.enablingOption.value =>
+ case d: Warning =>
+ printMessageAndPos(s"warning: ${d.msg}", d.pos)
+ case _ =>
+ printMessageAndPos(d.msg, d.pos)
+ }
def displayPrompt(): Unit = {
writer.print("\na)bort, s)tack, r)esume: ")