fixes #15129 [backport:1.2] (#15144)

(cherry picked from commit d6161e7e9e)
This commit is contained in:
Andreas Rumpf
2020-08-01 22:03:15 +02:00
committed by narimiran
parent 0aec43e850
commit 0ddf7153b8

View File

@@ -785,7 +785,7 @@ proc track(tracked: PEffects, n: PNode) =
if n.sym.typ != nil and tfHasAsgn in n.sym.typ.flags:
tracked.owner.flags.incl sfInjectDestructors
# bug #15038: ensure consistency
if not hasDestructor(n.typ): n.typ = n.sym.typ
if not hasDestructor(n.typ) and sameType(n.typ, n.sym.typ): n.typ = n.sym.typ
of nkRaiseStmt:
if n[0].kind != nkEmpty:
n[0].info = n.info