This commit is contained in:
Araq
2015-03-21 15:27:22 +01:00
parent 5641be51c1
commit 0591c68aaf
2 changed files with 18 additions and 1 deletions

View File

@@ -0,0 +1,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)