aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/reporting/StoreReporter.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/StoreReporter.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/StoreReporter.scala')
-rw-r--r--src/dotty/tools/dotc/reporting/StoreReporter.scala10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/reporting/StoreReporter.scala b/src/dotty/tools/dotc/reporting/StoreReporter.scala
index 67b90eec0..ea8199102 100644
--- a/src/dotty/tools/dotc/reporting/StoreReporter.scala
+++ b/src/dotty/tools/dotc/reporting/StoreReporter.scala
@@ -4,7 +4,7 @@ package reporting
import core.Contexts.Context
import collection.mutable
-import Reporter.Diagnostic
+import Reporter.{Diagnostic, Error, Warning}
import config.Printers._
/**
@@ -20,6 +20,14 @@ class StoreReporter extends Reporter {
infos += d
}
+ override def hasPending: Boolean = infos != null && {
+ infos exists {
+ case d: Error => true
+ case d: Warning => true
+ case _ => false
+ }
+ }
+
override def flush()(implicit ctx: Context) =
if (infos != null) infos foreach ctx.reporter.report
}