summary refs log tree commit diff stats
path: root/compiler/evals.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/evals.nim')
-rw-r--r--compiler/evals.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/evals.nim b/compiler/evals.nim
index 84f0266ea..8c05d57fc 100644
--- a/compiler/evals.nim
+++ b/compiler/evals.nim
@@ -1532,10 +1532,11 @@ var oldErrorCount: int
 
 proc myProcess(c: PPassContext, n: PNode): PNode =
   # don't eval errornous code:
-  if oldErrorCount != msgs.gErrorCounter:
-    oldErrorCount = msgs.gErrorCounter
-    return n
-  result = eval(PEvalContext(c), n)
+  if oldErrorCount == msgs.gErrorCounter:
+    result = eval(PEvalContext(c), n)
+  else:
+    result = n
+  oldErrorCount = msgs.gErrorCounter
 
 const evalPass* = makePass(myOpen, nil, myProcess, myProcess)