diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index ef32dc93a6..9211786da5 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -2047,7 +2047,7 @@ proc genDestroy(p: BProc; n: PNode) = else: discard "nothing to do" else: let t = n[1].typ.skipTypes(abstractVar) - if t.destructor != nil and t.destructor.magic != mDestroy: + if t.destructor != nil and t.destructor.ast[bodyPos].len != 0: internalError(p.config, n.info, "destructor turned out to be not trivial") discard "ignore calls to the default destructor"