VM: repl supports global variables properly"

This commit is contained in:
Araq 2015-08-16 11:25:30 +02:00
commit cc934a1a1b

View file

@ -1183,7 +1183,7 @@ proc checkCanEval(c: PCtx; n: PNode) =
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:
not s.isOwnedBy(c.prc.sym) and s.owner != c.module and c.mode != emRepl:
cannotEval(n)
elif s.kind in {skProc, skConverter, skMethod,
skIterator, skClosureIterator} and sfForward in s.flags: