Merge pull request #1582 from fowlmouth/patch-1

fix issue #1581
This commit is contained in:
Andreas Rumpf 2014-10-21 21:48:05 +02:00
commit 8910908eff

View file

@ -1126,6 +1126,7 @@ proc checkCanEval(c: PCtx; n: PNode) =
# we need to ensure that we don't evaluate 'x' here: # we need to ensure that we don't evaluate 'x' here:
# proc foo() = var x ... # proc foo() = var x ...
let s = n.sym let s = n.sym
if {sfCompileTime, sfGlobal} <= s.flags: return
if s.kind in {skVar, skTemp, skLet, skParam, skResult} and 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:
cannotEval(n) cannotEval(n)