Add testcase for #12129 (#14940)

* Add testcase for #12129

* Fix test
This commit is contained in:
Clyybber 2020-07-08 22:04:21 +02:00 • committed by GitHub
commit 9016dd96ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,6 +19,8 @@ nil
42 42
false false
true true
@[i0, i1, i2, i3, i4]
@[tmp, tmp, tmp, tmp, tmp]
''' '''
output: ''' output: '''
@ -244,3 +246,15 @@ macro toRendererBug(n): untyped =
result = newLit repr(n) result = newLit repr(n)
echo toRendererBug(0o377'i8) 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()