summary refs log tree commit diff stats
path: root/tests/vm
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-04-04 10:19:20 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-04-04 10:19:20 +0200
commit6d675814091b20312cbe51b69261453e04e27214 (patch)
tree352d80cc357ada646ed105fb9f7991c46735553e /tests/vm
parentcbcdf12d2c78de352d3f5149882cca2b0b72522d (diff)
downloadNim-6d675814091b20312cbe51b69261453e04e27214.tar.gz
fixes #3859
Diffstat (limited to 'tests/vm')
-rw-r--r--tests/vm/tmitems.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/vm/tmitems.nim b/tests/vm/tmitems.nim
index 18f5bfa06..4ee225eed 100644
--- a/tests/vm/tmitems.nim
+++ b/tests/vm/tmitems.nim
@@ -1,5 +1,8 @@
 discard """
   msg: '''13'''
+  output: '''3
+3
+3'''
 """
 # bug #3731
 var list {.compileTime.} = newSeq[int]()
@@ -13,3 +16,16 @@ macro calc*(): stmt {.immediate.} =
     echo c
 
 calc()
+
+# bug #3859
+import macros
+macro m: stmt =
+  var s = newseq[NimNode](3)
+  # var s: array[3,NimNode]                 # not working either
+  for i in 0..<s.len: s[i] = newLit(3)    # works
+  #for x in s.mitems: x = newLit(3)
+  result = newStmtList()
+  for i in s:
+    result.add newCall(bindsym"echo", i)
+
+m()