diff options
author | Araq <rumpf_a@web.de> | 2019-04-17 17:26:59 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2019-04-17 17:26:59 +0200 |
commit | 7640a230fc6166bb7fcc18bcab4251d7f6dc6caf (patch) | |
tree | f5ff43cfe6f85b46eb2f4a3eef3f3c4ecbb59295 /compiler/transf.nim | |
parent | 850e90ac303cf791369e5fe4827fa1ab2269bdad (diff) | |
download | Nim-7640a230fc6166bb7fcc18bcab4251d7f6dc6caf.tar.gz |
fixes #11050
Diffstat (limited to 'compiler/transf.nim')
-rw-r--r-- | compiler/transf.nim | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/transf.nim b/compiler/transf.nim index c455e3319..25a8bc5dd 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -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 |