Skip to content

Commit

Permalink
remove unwanted changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cooldome committed Dec 31, 2019
1 parent 5f0c69e commit 5018297
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 2 additions & 5 deletions compiler/injectdestructors.nim
Original file line number Diff line number Diff line change
Expand Up @@ -612,11 +612,8 @@ proc p(n: PNode; c: var Con; mode: ProcessMode): PNode =
proc moveOrCopy(dest, ri: PNode; c: var Con): PNode =
case ri.kind
of nkCallKinds:
if isUnpackedTuple(dest):
result = newTree(nkFastAsgn, dest, p(ri, c, consumed))
else:
result = genSink(c, dest, ri)
result.add p(ri, c, consumed)
result = genSink(c, dest, ri)
result.add p(ri, c, consumed)
of nkBracketExpr:
if isUnpackedTuple(ri[0]):
# unpacking of tuple: take over elements
Expand Down
1 change: 1 addition & 0 deletions tests/destructor/t12037.nim
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ proc bug(start: (seq[int], int)) =

let input = @[0]
bug((input, 0))
doASsert(input.len == 1)

0 comments on commit 5018297

Please sign in to comment.