summary refs log tree commit diff stats
path: root/tests/vm/tmitems.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vm/tmitems.nim')
-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()