From df2fdaf3c5fb8249c47be7566543be3482f9cb48 Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 14 Feb 2015 14:45:49 +0100 Subject: [PATCH] fixes #2121 --- compiler/ccgstmts.nim | 2 +- tests/tuples/tgeneric_tuple.nim | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/tuples/tgeneric_tuple.nim diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index 18705c9741..61568c9e62 100644 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -48,7 +48,7 @@ proc genVarTuple(p: BProc, n: PNode) = return genLineDir(p, n) initLocExpr(p, n.sons[L-1], tup) - var t = tup.t + var t = tup.t.getUniqueType for i in countup(0, L-3): var v = n.sons[i].sym if sfCompileTime in v.flags: continue diff --git a/tests/tuples/tgeneric_tuple.nim b/tests/tuples/tgeneric_tuple.nim new file mode 100644 index 0000000000..32f0815964 --- /dev/null +++ b/tests/tuples/tgeneric_tuple.nim @@ -0,0 +1,9 @@ +# bug #2121 + +type + Item[K,V] = tuple + key: K + value: V + +var q = newseq[Item[int,int]](0) +let (x,y) = q[0]