mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
fixes #2369
This commit is contained in:
@@ -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
|
||||
|
||||
17
tests/tuples/tgeneric_tuple2.nim
Normal file
17
tests/tuples/tgeneric_tuple2.nim
Normal 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)
|
||||
Reference in New Issue
Block a user