From a0c5260c205950c473f3de876dd0bb0b1e199c7c Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Tue, 17 Oct 2017 13:09:28 +0200 Subject: [PATCH] destructors: bugfix: lhs of assignment is irrelevant --- compiler/destroyer.nim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/destroyer.nim b/compiler/destroyer.nim index f97c448619..d87e648dbb 100644 --- a/compiler/destroyer.nim +++ b/compiler/destroyer.nim @@ -251,8 +251,7 @@ proc p(n: PNode; c: var Con): PNode = result = copyNode(n) recurse(n, result) of nkAsgn, nkFastAsgn: - # XXX if special, call special operator - if n[0].kind == nkSym and interestingSym(n[0].sym): + if hasDestructor(n[0].typ): result = moveOrCopy(n[0], n[1], c) else: result = copyNode(n)