This commit is contained in:
Araq
2013-03-17 20:11:16 +01:00
parent 3703bb929b
commit 6ed18a8b24
2 changed files with 12 additions and 1 deletions

View File

@@ -1088,7 +1088,10 @@ proc genObjConstr(p: BProc, e: PNode, d: var TLoc) =
tmp2.s = onHeap
tmp2.heapRoot = tmp.r
expr(p, it.sons[1], tmp2)
genAssignment(p, d, tmp, {})
if d.k == locNone:
d = tmp
else:
genAssignment(p, d, tmp, {})
proc genSeqConstr(p: BProc, t: PNode, d: var TLoc) =
var arr: TLoc

View File

@@ -0,0 +1,8 @@
type TFoo{.exportc.} = object
x:int
var s{.exportc.}: seq[TFoo] = @[]
s.add TFoo(x: 42)
echo s[0].x