diff options
author | Araq <rumpf_a@web.de> | 2015-02-14 14:45:49 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-02-14 14:45:49 +0100 |
commit | df2fdaf3c5fb8249c47be7566543be3482f9cb48 (patch) | |
tree | 08a555ee5f3caa26456288a6975958a6bd00560d | |
parent | 199707c189a169c4bf0b00f09775c9b7fa9343f3 (diff) | |
download | Nim-df2fdaf3c5fb8249c47be7566543be3482f9cb48.tar.gz |
fixes #2121
-rw-r--r-- | compiler/ccgstmts.nim | 2 | ||||
-rw-r--r-- | tests/tuples/tgeneric_tuple.nim | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index 18705c974..61568c9e6 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 000000000..32f081596 --- /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] |