From ab95d83444c6397f8859713dd6606602c77c8d23 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 4 Nov 2013 11:29:00 +0100 Subject: Upgraded handling of positions It turned out the some trees were still carrying NoPosition in their pos fields. The new treatment avoids that and aslo adds some assertions to check for regressions. --- src/dotty/tools/dotc/core/TyperState.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/core/TyperState.scala') diff --git a/src/dotty/tools/dotc/core/TyperState.scala b/src/dotty/tools/dotc/core/TyperState.scala index 8fbd3502c..664655d7c 100644 --- a/src/dotty/tools/dotc/core/TyperState.scala +++ b/src/dotty/tools/dotc/core/TyperState.scala @@ -127,10 +127,16 @@ extends TyperState(reporter) { override def withCheckingDisabled[T](op: => T)(implicit ctx: Context): T = { val prev = enableChecking(false) + var thrown = false try op + catch { + case ex: Throwable => + thrown = true + throw ex + } finally { enableChecking(prev) - checkConsistent + if (!thrown) checkConsistent } } -- cgit v1.2.3