destructors: supportsCopyMem finally works for recursive types
This commit is contained in:
parent
4f2b79a380
commit
3aa7c2232e
6 changed files with 53 additions and 18 deletions
|
|
@ -319,6 +319,8 @@ proc liftTypeBoundOps*(c: PContext; typ: PType; info: TLineInfo) =
|
|||
## to ensure we lift assignment, destructors and moves properly.
|
||||
## The later 'destroyer' pass depends on it.
|
||||
if not newDestructors or not hasDestructor(typ): return
|
||||
# do not produce wrong liftings while we're still instantiating generics:
|
||||
if c.typesWithOps.len > 0: return
|
||||
let typ = typ.skipTypes({tyGenericInst, tyAlias})
|
||||
# we generate the destructor first so that other operators can depend on it:
|
||||
if typ.destructor == nil:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue