aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/reporting/ThrowingReporter.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-05-04 13:42:45 +0200
committerSamuel Gruetter <samuel.gruetter@epfl.ch>2014-05-20 13:37:35 +0200
commit94ceb9895a539b05fd81c8abe040c276178b5507 (patch)
tree84992aee9920f62e4ffbf62529b32cffd2c3b505 /src/dotty/tools/dotc/reporting/ThrowingReporter.scala
parent1b32071acef5c7c2c08e21ee577c7cc709876ffa (diff)
downloaddotty-94ceb9895a539b05fd81c8abe040c276178b5507.tar.gz
dotty-94ceb9895a539b05fd81c8abe040c276178b5507.tar.bz2
dotty-94ceb9895a539b05fd81c8abe040c276178b5507.zip
Reporter refactoring
Refactored reporters to increase clarity and to pave the way for having Diagnostics subclasses.
Diffstat (limited to 'src/dotty/tools/dotc/reporting/ThrowingReporter.scala')
-rw-r--r--src/dotty/tools/dotc/reporting/ThrowingReporter.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/reporting/ThrowingReporter.scala b/src/dotty/tools/dotc/reporting/ThrowingReporter.scala
index d44a08fb6..eb854d513 100644
--- a/src/dotty/tools/dotc/reporting/ThrowingReporter.scala
+++ b/src/dotty/tools/dotc/reporting/ThrowingReporter.scala
@@ -10,6 +10,8 @@ import Reporter._
* This class implements a Reporter that stores all messages
*/
class ThrowingReporter(reportInfo: Reporter) extends Reporter {
- protected def doReport(d: Diagnostic)(implicit ctx: Context): Unit =
- if (d.severity == ERROR) throw d else reportInfo.report(d)
+ protected def doReport(d: Diagnostic)(implicit ctx: Context): Unit = d match {
+ case _: Error => throw d
+ case _ => reportInfo.report(d)
+ }
}