summary refs log tree commit diff stats
path: root/tests/stdlib/tmacros.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdlib/tmacros.nim')
-rw-r--r--tests/stdlib/tmacros.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/stdlib/tmacros.nim b/tests/stdlib/tmacros.nim
index 974594dee..06a9a9c27 100644
--- a/tests/stdlib/tmacros.nim
+++ b/tests/stdlib/tmacros.nim
@@ -334,3 +334,16 @@ block:
       `hello`(12, type(x))
 
   main()
+
+block: # bug #22947
+  macro bar[N: static int](a: var array[N, int]) =
+    result = quote do:
+      for i in 0 ..< `N`:
+        `a`[i] = i
+
+  func foo[N: static int](a: var array[N, int]) =
+    bar(a)
+
+
+  var a: array[4, int]
+  foo(a)