diff options
author | Martin Odersky <odersky@gmail.com> | 2015-10-26 09:41:25 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-10-26 09:43:50 +0100 |
commit | d4f30d1a268a51ee74c98f6ae0f45136274536af (patch) | |
tree | 18a7e21c87f31a9e90f3cf5c40d0cd2c9be19763 /src/dotty/tools/dotc/reporting/StoreReporter.scala | |
parent | 75ac4010609c7d3ac856523d8f2d59e710a4c58c (diff) | |
download | dotty-d4f30d1a268a51ee74c98f6ae0f45136274536af.tar.gz dotty-d4f30d1a268a51ee74c98f6ae0f45136274536af.tar.bz2 dotty-d4f30d1a268a51ee74c98f6ae0f45136274536af.zip |
Keep separate chain of outer reporters for StoreReporters
Used in rewritten `errorsReported` method. This fixes #866. The problem
before was that `TyperState#trywithFallBack` temporarily updates
the reporter, so crawling up the context chain to check for reporters
with errors missed some reported errors, which triggered the assertion
in `Tree#withType`.
Diffstat (limited to 'src/dotty/tools/dotc/reporting/StoreReporter.scala')
-rw-r--r-- | src/dotty/tools/dotc/reporting/StoreReporter.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/reporting/StoreReporter.scala b/src/dotty/tools/dotc/reporting/StoreReporter.scala index 51d3df110..1991790b5 100644 --- a/src/dotty/tools/dotc/reporting/StoreReporter.scala +++ b/src/dotty/tools/dotc/reporting/StoreReporter.scala @@ -10,7 +10,7 @@ import config.Printers._ /** * This class implements a Reporter that stores all messages */ -class StoreReporter extends Reporter { +class StoreReporter(outer: Reporter) extends Reporter { private var infos: mutable.ListBuffer[Diagnostic] = null @@ -33,4 +33,6 @@ class StoreReporter extends Reporter { infos foreach ctx.reporter.report infos = null } + + override def errorsReported = hasErrors || outer.errorsReported } |