(cherry picked from commit 3258c1e2a3)
This commit is contained in:
Andreas Rumpf
2019-07-07 00:29:43 +02:00
committed by narimiran
parent 5dfec61597
commit 615be176e6

View File

@@ -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"