diff options
author | Martin Odersky <odersky@gmail.com> | 2014-05-04 13:42:45 +0200 |
---|---|---|
committer | Samuel Gruetter <samuel.gruetter@epfl.ch> | 2014-05-20 13:37:35 +0200 |
commit | 94ceb9895a539b05fd81c8abe040c276178b5507 (patch) | |
tree | 84992aee9920f62e4ffbf62529b32cffd2c3b505 /src/dotty/tools/dotc/reporting/ThrowingReporter.scala | |
parent | 1b32071acef5c7c2c08e21ee577c7cc709876ffa (diff) | |
download | dotty-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.scala | 6 |
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) + } } |