tgeneric_tuple2.nim 357 B

123456789101112131415161718
  1. # bug #2369
  2. type HashedElem[T] = tuple[num: int, storedVal: ref T]
  3. proc append[T](tab: var seq[HashedElem[T]], n: int, val: ref T) =
  4. #tab.add((num: n, storedVal: val))
  5. var he: HashedElem[T] = (num: n, storedVal: val)
  6. #tab.add(he)
  7. var g: seq[HashedElem[int]] = @[]
  8. proc foo() =
  9. var x: ref int
  10. new(x)
  11. x[] = 77
  12. g.append(44, x)