From 275c7ccf82e03622258c135890c0419e70ee0884 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 10 Sep 2013 22:04:12 +0200 Subject: [PATCH] fixes #575 --- compiler/ccgexprs.nim | 3 +-- compiler/cgen.nim | 8 +------- lib/system/assign.nim | 2 ++ lib/system/channels.nim | 4 +++- tests/run/tobjasgn.nim | 39 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 46 insertions(+), 10 deletions(-) create mode 100644 tests/run/tobjasgn.nim diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 6b39062269..c50fd4536c 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -304,7 +304,7 @@ proc genAssignment(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) = of tyObject: # XXX: check for subtyping? if needsComplexAssignment(ty): - if asgnComplexity(ty.n) <= 4: + if ty.sons[0].isNil and asgnComplexity(ty.n) <= 4: discard getTypeDesc(p.module, ty) internalAssert ty.n != nil genOptAsgnObject(p, dest, src, flags, ty.n) @@ -1017,7 +1017,6 @@ proc genObjConstr(p: BProc, e: PNode, d: var TLoc) = rawGenNew(p, tmp, nil) t = t.sons[0].skipTypes(abstractInst) r = ropef("(*$1)", r) - # XXX object initialization? but not necessary for temps, is it? discard getTypeDesc(p.module, t) for i in 1 ..