summary refs log tree commit diff stats
path: root/tests/template
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-09-02 15:47:56 +0200
committerGitHub <noreply@github.com>2019-09-02 15:47:56 +0200
commit7ef85db9a9e3df4d6630673ceac33e9fb986e2ed (patch)
tree529940ba28d24b3e396742352570cc742d92ab5b /tests/template
parentfc7fe636e22f1a9a502e805256c01c70e8695f88 (diff)
downloadNim-7ef85db9a9e3df4d6630673ceac33e9fb986e2ed.tar.gz
fixes #12020 (#12106)
Diffstat (limited to 'tests/template')
-rw-r--r--tests/template/tparams_gensymed.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/template/tparams_gensymed.nim b/tests/template/tparams_gensymed.nim
index f7a02efa0..fe5608add 100644
--- a/tests/template/tparams_gensymed.nim
+++ b/tests/template/tparams_gensymed.nim
@@ -9,6 +9,11 @@ output: '''
 2
 3
 wth
+3
+2
+1
+0
+(total: 6)
 '''
 """
 # bug #1915
@@ -145,3 +150,17 @@ macro m(): untyped =
 
 let meh = m()
 meh("wth")
+
+
+macro foo(body: untyped): untyped =
+  result = body
+
+template baz(): untyped =
+  foo:
+    proc bar2(b: int): int =
+      echo b
+      if b > 0: b + bar2(b = b - 1)
+      else: 0
+  echo (total: bar2(3))
+
+baz()