mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-17 16:38:33 +00:00
add comment
This commit is contained in:
@@ -620,7 +620,8 @@ proc p(n: PNode; c: var Con): PNode =
|
||||
of nkAsgn, nkFastAsgn:
|
||||
if hasDestructor(n[0].typ):
|
||||
result = moveOrCopy(n[0], n[1], c)
|
||||
c.enableDestructor(n[0].sym)
|
||||
c.enableDestructor(n[0].sym) # last read to sink argument could have disabled the destructor
|
||||
# but the variable is assigned again and new value should be destroyed
|
||||
else:
|
||||
result = copyNode(n)
|
||||
recurse(n, result)
|
||||
|
||||
Reference in New Issue
Block a user