diff options
author | Araq <rumpf_a@web.de> | 2012-06-26 01:00:32 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-06-26 01:00:32 +0200 |
commit | b5d34242ca7156ec702f8e63a01c9cd059d28e5f (patch) | |
tree | 4c44e50159d95b15f3ac82ddead4212384526fd3 /compiler/seminst.nim | |
parent | 5a838d3e06222f44b4c9876774ea2bd304afcc49 (diff) | |
download | Nim-b5d34242ca7156ec702f8e63a01c9cd059d28e5f.tar.gz |
added proc annotations: macros invoked as pragmas
Diffstat (limited to 'compiler/seminst.nim')
-rwxr-xr-x | compiler/seminst.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/seminst.nim b/compiler/seminst.nim index f44b80223..a2f4129ea 100755 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -139,6 +139,8 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, # generates an instantiated proc if c.InstCounter > 1000: InternalError(fn.ast.info, "nesting too deep") inc(c.InstCounter) + # careful! we copy the whole AST including the possibly nil body! + var n = copyTree(fn.ast) # NOTE: for access of private fields within generics from a different module # we set the friend module: var oldFriend = c.friendModule @@ -148,8 +150,6 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable, # keep the owner if it's an inner proc (for proper closure transformations): if fn.owner.kind == skModule: result.owner = getCurrOwner().owner - # careful! we copy the whole AST including the possibly nil body! - var n = copyTree(fn.ast) result.ast = n pushOwner(result) openScope(c.tab) |