From f9d4e39a12238d48cd7b8ab461055fe48b989967 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 7 Apr 2013 14:12:08 +0200 Subject: bugfix evals.nim --- compiler/evals.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler') 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) -- cgit 1.4.1-2-gfad0