summary refs log tree commit diff stats
path: root/compiler/sem.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-03-13 02:52:51 +0100
committerAraq <rumpf_a@web.de>2014-03-13 02:52:51 +0100
commit1c35fb3c89bbac393b50c4bc6fe8205af2b7fb9d (patch)
tree6f72beee37e3873a1434e10e8bb0fd156acdef78 /compiler/sem.nim
parent2fc84325c7cfba82c54c652a5f1a795845b169a9 (diff)
parentd2f130c3fc1ffa786e8d323c3cd3c51fd45124da (diff)
downloadNim-1c35fb3c89bbac393b50c4bc6fe8205af2b7fb9d.tar.gz
Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
Diffstat (limited to 'compiler/sem.nim')
-rw-r--r--compiler/sem.nim18
1 files changed, 15 insertions, 3 deletions
diff --git a/compiler/sem.nim b/compiler/sem.nim
index c8228618b..093fc9452 100644
--- a/compiler/sem.nim
+++ b/compiler/sem.nim
@@ -219,14 +219,26 @@ proc tryConstExpr(c: PContext, n: PNode): PNode =
   result = getConstExpr(c.module, e)
   if result != nil: return
 
+  let oldErrorCount = msgs.gErrorCounter
+  let oldErrorMax = msgs.gErrorMax
+  let oldErrorOutputs = errorOutputs
+
+  errorOutputs = {}
+  msgs.gErrorMax = high(int)
+
   try:
     result = evalConstExpr(c.module, e)
     if result == nil or result.kind == nkEmpty:
-      return nil
+      result = nil
+    else:
+      result = fixupTypeAfterEval(c, result, e)
 
-    result = fixupTypeAfterEval(c, result, e)
   except ERecoverableError:
-    return nil
+    result = nil
+
+  msgs.gErrorCounter = oldErrorCount
+  msgs.gErrorMax = oldErrorMax
+  errorOutputs = oldErrorOutputs
 
 proc semConstExpr(c: PContext, n: PNode): PNode =
   var e = semExprWithType(c, n)