summary refs log tree commit diff stats
path: root/compiler/semtempl.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-03-13 22:29:48 +0100
committerAraq <rumpf_a@web.de>2014-03-13 22:29:48 +0100
commit3e056afb1c481d35403c93bc17307b46be5e20f2 (patch)
tree997aeee1899a13d4a7014d4713252eaf27effd2f /compiler/semtempl.nim
parent1c35fb3c89bbac393b50c4bc6fe8205af2b7fb9d (diff)
downloadNim-3e056afb1c481d35403c93bc17307b46be5e20f2.tar.gz
fixes #993
Diffstat (limited to 'compiler/semtempl.nim')
-rw-r--r--compiler/semtempl.nim8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim
index 42268d44f..363c5246f 100644
--- a/compiler/semtempl.nim
+++ b/compiler/semtempl.nim
@@ -155,7 +155,11 @@ proc addLocalDecl(c: var TemplCtx, n: var PNode, k: TSymKind) =
       of nkPragmaExpr: x = x[0]
       of nkIdent: break
       else: illFormedAst(x)
-    c.toInject.incl(x.ident.id)
+    let ident = getIdentNode(c, x)
+    if not isTemplParam(c, ident):
+      c.toInject.incl(x.ident.id)
+    else:
+      replaceIdentBySym(n, ident)
   else:
     let ident = getIdentNode(c, n)
     if not isTemplParam(c, ident):
@@ -359,6 +363,8 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode =
     result = semRoutineInTemplBody(c, n, skConverter)
   of nkPragmaExpr:
     result.sons[0] = semTemplBody(c, n.sons[0])
+  of nkPostfix:
+    result.sons[1] = semTemplBody(c, n.sons[1])
   of nkPragma:
     discard
   else: