summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/vmgen.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim
index fac3cf1bf..e0e34306c 100644
--- a/compiler/vmgen.nim
+++ b/compiler/vmgen.nim
@@ -1126,6 +1126,7 @@ proc checkCanEval(c: PCtx; n: PNode) =
   # we need to ensure that we don't evaluate 'x' here:
   # proc foo() = var x ...
   let s = n.sym
+  if {sfCompileTime, sfGlobal} <= s.flags: return
   if s.kind in {skVar, skTemp, skLet, skParam, skResult} and 
       not s.isOwnedBy(c.prc.sym) and s.owner != c.module:
     cannotEval(n)