diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2008-08-23 11:16:44 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2008-08-23 11:16:44 +0200 |
commit | 07d5a8085bbcc21a1d9d06a2976ecc00e9c8d55b (patch) | |
tree | b07a53afeb56f4bba917c1a3a843f48dd25b62be /lib/assign.nim | |
parent | 916c25f9a70b68eb7a5e2c45d7cc2e10c6e3a525 (diff) | |
download | Nim-07d5a8085bbcc21a1d9d06a2976ecc00e9c8d55b.tar.gz |
too many changes to list
Diffstat (limited to 'lib/assign.nim')
-rw-r--r-- | lib/assign.nim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/assign.nim b/lib/assign.nim index c8592b970..5ac475ef0 100644 --- a/lib/assign.nim +++ b/lib/assign.nim @@ -55,7 +55,8 @@ proc genericAssign(dest, src: Pointer, mt: PNimType) = var dstseq = cast[PGenericSeq](dst) dstseq.len = seq.len dstseq.space = seq.len - of tyRecord, tyObject, tyTuple: + of tyObject, tyTuple, tyPureObject: + # we don't need to copy m_type field for tyObject, as they are equal anyway genericAssignAux(dest, src, mt.node) of tyArray, tyArrayConstr: for i in 0..(mt.size div mt.base.size)-1: @@ -75,6 +76,7 @@ proc genericAssign(dest, src: Pointer, mt: PNimType) = copyMem(dest, src, mt.size) # copy raw bits proc genericSeqAssign(dest, src: Pointer, mt: PNimType) {.compilerProc.} = + var src = src # ugly, but I like to stress the parser sometimes :-) genericAssign(dest, addr(src), mt) proc genericAssignOpenArray(dest, src: pointer, len: int, @@ -110,7 +112,7 @@ proc objectInit(dest: Pointer, typ: PNimType) = var pint = cast[ptr PNimType](dest) pint^ = typ objectInitAux(dest, typ.node) - of tyRecord: + of tyTuple, tyPureObject: objectInitAux(dest, typ.node) of tyArray, tyArrayConstr: for i in 0..(typ.size div typ.base.size)-1: |