mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-07 12:24:19 +00:00
destructors: bugfix: lhs of assignment is irrelevant
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user