fixes #11050
This commit is contained in:
parent
850e90ac30
commit
7640a230fc
3 changed files with 34 additions and 7 deletions
|
|
@ -651,6 +651,8 @@ proc transformFor(c: PTransf, n: PNode): PTransNode =
|
|||
var t = formal.typ
|
||||
if formal.ast != nil and formal.ast.typ.destructor != nil and t.destructor == nil:
|
||||
t = formal.ast.typ # better use the type that actually has a destructor.
|
||||
elif t.destructor == nil and arg.typ.destructor != nil:
|
||||
t = arg.typ
|
||||
# generate a temporary and produce an assignment statement:
|
||||
var temp = newTemp(c, t, formal.info)
|
||||
#temp.sym.flags.incl sfCursor
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue