From 928c2fee06bd11a0901c5f563b4953788be76ae6 Mon Sep 17 00:00:00 2001 From: Andrii Riabushenko Date: Tue, 31 Dec 2019 00:07:49 +0000 Subject: [PATCH] fixes #12989 --- compiler/lowerings.nim | 1 - tests/destructor/t12037.nim | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/compiler/lowerings.nim b/compiler/lowerings.nim index ac29d600bf860..cf8445820580b 100644 --- a/compiler/lowerings.nim +++ b/compiler/lowerings.nim @@ -60,7 +60,6 @@ proc lowerTupleUnpacking*(g: ModuleGraph; n: PNode; owner: PSym): PNode = var temp = newSym(skTemp, getIdent(g.cache, genPrefix), owner, value.info, g.config.options) temp.typ = skipTypes(value.typ, abstractInst) incl(temp.flags, sfFromGeneric) - incl(temp.flags, sfCursor) var v = newNodeI(nkVarSection, value.info) let tempAsNode = newSymNode(temp) diff --git a/tests/destructor/t12037.nim b/tests/destructor/t12037.nim index 57ebae9e4e5b7..1a7d536cc68f9 100644 --- a/tests/destructor/t12037.nim +++ b/tests/destructor/t12037.nim @@ -23,3 +23,12 @@ test() import tables var t = initTable[string, seq[ptr int]]() discard t.hasKeyOrPut("f1", @[]) + + +############################################# +### bug #12989 +proc bug(start: (seq[int], int)) = + let (s, i) = start + +let input = @[0] +bug((input, 0))