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

@@ -456,7 +456,7 @@ proc changeType(n: PNode, newType: PType, check: bool) =
internalError(m.info, "changeType(): invalid tuple constr")
return
if tup.n != nil:
var f = getSymFromList(newType.n, m.sym.name)
var f = getSymFromList(tup.n, m.sym.name)
if f == nil:
internalError(m.info, "changeType(): invalid identifier")
return

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)