summary refs log tree commit diff stats
path: root/tests/vm/tstaticprintseq.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vm/tstaticprintseq.nim')
-rw-r--r--tests/vm/tstaticprintseq.nim36
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/vm/tstaticprintseq.nim b/tests/vm/tstaticprintseq.nim
index 99a56d161..4575f3af1 100644
--- a/tests/vm/tstaticprintseq.nim
+++ b/tests/vm/tstaticprintseq.nim
@@ -4,7 +4,17 @@ discard """
 3
 1
 2
-3'''
+3
+1
+2
+3
+1
+2
+3
+aa
+bb
+aa
+bb'''
 """
 
 const s = @[1,2,3]
@@ -19,3 +29,27 @@ static:
   for e in s:
     echo e
 
+macro bar(x: static[seq[int]]): stmt =
+  for e in x:
+    echo e
+
+bar s
+bar(@[1, 2, 3])
+
+type
+  TData = tuple
+    letters: seq[string]
+    numbers: seq[int]
+
+const data: TData = (@["aa", "bb"], @[11, 22])
+
+static:
+  var m = data
+  for x in m.letters:
+    echo x
+
+macro ff(d: static[TData]): stmt =
+  for x in d.letters:
+    echo x
+
+ff(data)