This commit is contained in:
Billingsly Wetherfordshire
2014-10-20 19:12:10 -05:00
parent e0bdf4f4bf
commit 50d9db03c6

View File

@@ -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)