summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/evals.nim9
-rw-r--r--compiler/lookups.nim3
2 files changed, 7 insertions, 5 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)
 
diff --git a/compiler/lookups.nim b/compiler/lookups.nim
index 191a7aa55..e1ec9e14b 100644
--- a/compiler/lookups.nim
+++ b/compiler/lookups.nim
@@ -91,7 +91,8 @@ proc errorSym*(c: PContext, n: PNode): PSym =
   result.typ = errorType(c)
   incl(result.flags, sfDiscardable)
   # pretend it's imported from some unknown module to prevent cascading errors:
-  c.importTable.addSym(result)
+  if gCmd != cmdInteractive:
+    c.importTable.addSym(result)
 
 type 
   TOverloadIterMode* = enum