summary refs log tree commit diff stats
path: root/tests/tuples/tgeneric_tuple2.nim
blob: c0c29238813d896f2be5c53c173f9b1cbb1d8042 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# bug #2369

type HashedElem[T] = tuple[num: int, storedVal: ref T]

proc append[T](tab: var seq[HashedElem[T]], n: int, val: ref T) =
    #tab.add((num: n, storedVal: val))
    var he: HashedElem[T] = (num: n, storedVal: val)
    #tab.add(he)

var g: seq[HashedElem[int]] = @[]

proc foo() =
    var x: ref int
    new(x)
    x[] = 77
    g.append(44, x)