aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TyperState.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/TyperState.scala')
-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)