diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim index 542e5ab054..5e4388d3c6 100644 --- a/compiler/semmagic.nim +++ b/compiler/semmagic.nim @@ -232,8 +232,7 @@ proc evalTypeTrait(c: PContext; traitCall: PNode, operand: PType, context: PSym) of "stripGenericParams": result = uninstantiate(operand).toNode(traitCall.info) of "supportsCopyMem": - let complexObj = supportsCopyMem(operand) - result = newIntNodeT(toInt128(ord(not complexObj)), traitCall, c.idgen, c.graph) + result = newIntNodeT(toInt128(ord(supportsCopyMem(operand))), traitCall, c.idgen, c.graph) of "canFormCycles": result = newIntNodeT(toInt128(ord(types.canFormAcycle(c.graph, operand))), traitCall, c.idgen, c.graph) of "hasDefaultValue": diff --git a/compiler/types.nim b/compiler/types.nim index d38c2a4140..62831624b9 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -1782,5 +1782,4 @@ proc reduceToBase*(f: PType): PType = proc supportsCopyMem*(t: PType): bool = let t = t.skipTypes({tyVar, tyLent, tyGenericInst, tyAlias, tySink, tyInferred}) - result = containsGarbageCollectedRef(t) or - hasDestructor(t) + result = not containsGarbageCollectedRef(t) and not hasDestructor(t)