diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim index f611ee8fe10d..0da9f37aba71 100644 --- a/compiler/sempass2.nim +++ b/compiler/sempass2.nim @@ -135,8 +135,9 @@ proc createTypeBoundOps(tracked: PEffects, typ: PType; info: TLineInfo) = createTypeBoundOps(tracked.graph, tracked.c, realType.lastSon, info) createTypeBoundOps(tracked.graph, tracked.c, typ, info, tracked.c.idgen) - if (tfHasAsgn in typ.flags) or - optSeqDestructors in tracked.config.globalOptions: + if tracked.config.selectedGC == gcRefc or + optSeqDestructors in tracked.config.globalOptions or + tfHasAsgn in typ.flags: tracked.owner.flags.incl sfInjectDestructors proc isLocalSym(a: PEffects, s: PSym): bool =