diff options
author | Araq <rumpf_a@web.de> | 2013-04-07 14:12:08 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-04-07 14:12:08 +0200 |
commit | f9d4e39a12238d48cd7b8ab461055fe48b989967 (patch) | |
tree | 9ea27b2e787233472353b001018720e6c84e333d /compiler | |
parent | 0b1630b46c9ab8ba5acb82bc04b998961cef4973 (diff) | |
download | Nim-f9d4e39a12238d48cd7b8ab461055fe48b989967.tar.gz |
bugfix evals.nim
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/evals.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/evals.nim b/compiler/evals.nim index 66b8de3d0..968170e85 100644 --- a/compiler/evals.nim +++ b/compiler/evals.nim @@ -295,8 +295,9 @@ proc evalVar(c: PEvalContext, n: PNode): PNode = # XXX var (x, y) = z support? #assert(a.sons[0].kind == nkSym) can happen for transformed vars if a.sons[2].kind != nkEmpty: - # XXX copyTree could be avoided in some cases - result = evalAux(c, a.sons[2], {}).copyTree + result = evalAux(c, a.sons[2], {}) + if result.kind in {nkType..nkNilLit}: + result = result.copyNode if isSpecial(result): return else: result = getNullValue(a.sons[0].typ, a.sons[0].info) |