diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-11-02 00:39:04 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-11-02 00:39:04 +0100 |
commit | 44a27ccfe1cd56f2e77979eba4814d94eec47b41 (patch) | |
tree | a145b167692c3572b4cf19bb2b50e2d8ec9472f7 /compiler/injectdestructors.nim | |
parent | 7a4d066102c3fdacaebb093699024693033742b1 (diff) | |
download | Nim-44a27ccfe1cd56f2e77979eba4814d94eec47b41.tar.gz |
--gc:destructors: simple closures work
Diffstat (limited to 'compiler/injectdestructors.nim')
-rw-r--r-- | compiler/injectdestructors.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/injectdestructors.nim b/compiler/injectdestructors.nim index f1823bf64..78ab2daef 100644 --- a/compiler/injectdestructors.nim +++ b/compiler/injectdestructors.nim @@ -173,6 +173,9 @@ proc genOp(c: Con; t: PType; kind: TTypeAttachedOp; dest, ri: PNode): PNode = elif op.ast[genericParamsPos].kind != nkEmpty: globalError(c.graph.config, dest.info, "internal error: '" & AttachedOpToStr[kind] & "' operator is generic") + dbg: + if kind == attachedDestructor: + echo "destructor is ", op.id, " ", op.ast if sfError in op.flags: checkForErrorPragma(c, t, ri, AttachedOpToStr[kind]) let addrExp = newNodeIT(nkHiddenAddr, dest.info, makePtrType(c, dest.typ)) addrExp.add(dest) @@ -681,4 +684,4 @@ proc injectDestructorCalls*(g: ModuleGraph; owner: PSym; n: PNode): PNode = result.add body dbg: echo ">---------transformed-to--------->" - echo result + echo renderTree(result, {renderIds}) |