diff options
author | Araq <rumpf_a@web.de> | 2019-04-10 10:10:08 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2019-04-10 10:10:08 +0200 |
commit | 0518794291f138c1120dc4a039f218598f380eb3 (patch) | |
tree | a4ad791076a0bbcf344772bb11441bc580096cde /compiler/transf.nim | |
parent | 6617b8deee321c6baf8844ac59ebab84f325b6a0 (diff) | |
download | Nim-0518794291f138c1120dc4a039f218598f380eb3.tar.gz |
make parseopt compile with --newruntime
Diffstat (limited to 'compiler/transf.nim')
-rw-r--r-- | compiler/transf.nim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/transf.nim b/compiler/transf.nim index a597123de..30c77fed9 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -648,8 +648,12 @@ proc transformFor(c: PTransf, n: PNode): PTransNode = of paDirectMapping: idNodeTablePut(newC.mapping, formal, arg) of paFastAsgn: + 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. # generate a temporary and produce an assignment statement: - var temp = newTemp(c, formal.typ, formal.info) + var temp = newTemp(c, t, formal.info) + #temp.sym.flags.incl sfCursor addVar(v, temp) add(stmtList, newAsgnStmt(c, nkFastAsgn, temp, arg.PTransNode)) idNodeTablePut(newC.mapping, formal, temp) |