fixes #185
This commit is contained in:
parent
1c6870712b
commit
c4c0c41d61
1 changed files with 7 additions and 2 deletions
|
|
@ -71,8 +71,13 @@ proc genericAssignAux(dest, src: Pointer, mt: PNimType, shallow: bool) =
|
||||||
var dstseq = cast[PGenericSeq](dst)
|
var dstseq = cast[PGenericSeq](dst)
|
||||||
dstseq.len = seq.len
|
dstseq.len = seq.len
|
||||||
dstseq.reserved = seq.len
|
dstseq.reserved = seq.len
|
||||||
of tyObject, tyTuple:
|
of tyObject:
|
||||||
# we don't need to copy m_type field for tyObject, as they are equal anyway
|
# we need to copy m_type field for tyObject, as it could be empty for
|
||||||
|
# sequence reallocations:
|
||||||
|
var pint = cast[ptr PNimType](dest)
|
||||||
|
pint[] = cast[ptr PNimType](src)[]
|
||||||
|
genericAssignAux(dest, src, mt.node, shallow)
|
||||||
|
of tyTuple:
|
||||||
genericAssignAux(dest, src, mt.node, shallow)
|
genericAssignAux(dest, src, mt.node, shallow)
|
||||||
of tyArray, tyArrayConstr:
|
of tyArray, tyArrayConstr:
|
||||||
for i in 0..(mt.size div mt.base.size)-1:
|
for i in 0..(mt.size div mt.base.size)-1:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue