From 615be176e6e7315401dc1f5fc646e294e695982e Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sun, 7 Jul 2019 00:29:43 +0200 Subject: [PATCH] fixes #11671 (cherry picked from commit 3258c1e2a3b9a7778e826e8739bdf865a25b61f8) --- compiler/ccgexprs.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"