aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-05-16 11:28:38 +0200
committerMartin Odersky <odersky@gmail.com>2014-05-30 14:34:33 +0200
commit3b247c34a4c8959b638c61b116635d6c7e80403a (patch)
treeeda682d35e45060d6087a197e7e9030ad90ad12f /src/dotty/tools/dotc
parente57fa24b34ab1836160be67a153cbaba2ebc6691 (diff)
downloaddotty-3b247c34a4c8959b638c61b116635d6c7e80403a.tar.gz
dotty-3b247c34a4c8959b638c61b116635d6c7e80403a.tar.bz2
dotty-3b247c34a4c8959b638c61b116635d6c7e80403a.zip
Reporter fix
This fixes a bug introuced by 7754c1ee6c4230e424fd99b820471dbd2c1c8390. The reporter state need to be reset undconditionally in a tryWithFallback.
Diffstat (limited to 'src/dotty/tools/dotc')
-rw-r--r--src/dotty/tools/dotc/core/TyperState.scala13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/core/TyperState.scala b/src/dotty/tools/dotc/core/TyperState.scala
index 6a3ac4467..8c742edab 100644
--- a/src/dotty/tools/dotc/core/TyperState.scala
+++ b/src/dotty/tools/dotc/core/TyperState.scala
@@ -152,12 +152,13 @@ extends TyperState(r) {
val savedConstraint = myConstraint
myReporter = new StoreReporter
val result = op
- if (!reporter.hasErrors) result
- else {
- myReporter = savedReporter
- myConstraint = savedConstraint
- fallback
- }
+ try
+ if (!reporter.hasErrors) result
+ else {
+ myConstraint = savedConstraint
+ fallback
+ }
+ finally myReporter = savedReporter
}
override def toText(printer: Printer): Text = constraint.toText(printer)