fixes destructor tuple regression #10940 (#10941)

* fixes #10940

* bug fixes

* fix spacing
This commit is contained in:
cooldome 2019-04-04 20:46:02 +01:00 • committed by GitHub
commit 795de374fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 56 additions and 3 deletions

View file

@ -776,7 +776,12 @@ proc track(tracked: PEffects, n: PNode) =
let last = lastSon(child)
if last.kind != nkEmpty: track(tracked, last)
if tracked.owner.kind != skMacro:
createTypeBoundOps(tracked.c, child[0].typ, child.info)
if child.kind == nkVarTuple:
createTypeBoundOps(tracked.c, child[^1].typ, child.info)
for i in 0..child.len-3:
createTypeBoundOps(tracked.c, child[i].typ, child.info)
else:
createTypeBoundOps(tracked.c, child[0].typ, child.info)
if child.kind == nkIdentDefs and last.kind != nkEmpty:
for i in 0 .. child.len-3:
initVar(tracked, child.sons[i], volatileCheck=false)