summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2020-07-08 22:04:21 +0200
committerGitHub <noreply@github.com>2020-07-08 22:04:21 +0200
commit9016dd96ee1ab6d3a60925cee4ee815dd8627f1e (patch)
tree15b6600d2c7fc47f39881e5e38e5d8096ffeb42f /tests
parentbc712c28fce6e8a849af305f1f84ab193c7cf090 (diff)
downloadNim-9016dd96ee1ab6d3a60925cee4ee815dd8627f1e.tar.gz
Add testcase for #12129 (#14940)
* Add testcase for #12129

* Fix test
Diffstat (limited to 'tests')
-rw-r--r--tests/macros/tmacros_issues.nim14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/macros/tmacros_issues.nim b/tests/macros/tmacros_issues.nim
index df385c445..23c9c66c0 100644
--- a/tests/macros/tmacros_issues.nim
+++ b/tests/macros/tmacros_issues.nim
@@ -19,6 +19,8 @@ nil
 42
 false
 true
+@[i0, i1, i2, i3, i4]
+@[tmp, tmp, tmp, tmp, tmp]
 '''
 
   output: '''
@@ -244,3 +246,15 @@ macro toRendererBug(n): untyped =
   result = newLit repr(n)
 
 echo toRendererBug(0o377'i8)
+
+# bug #12129
+macro foobar() =
+  var loopVars = newSeq[NimNode](5)
+  for i, sym in loopVars.mpairs():
+    sym = ident("i" & $i)
+  echo loopVars
+  for sym in loopVars.mitems():
+    sym = ident("tmp")
+  echo loopVars
+
+foobar()