summary refs log tree commit diff stats
path: root/tests/global/tglobalforvar.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/global/tglobalforvar.nim')
-rw-r--r--tests/global/tglobalforvar.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/global/tglobalforvar.nim b/tests/global/tglobalforvar.nim
new file mode 100644
index 000000000..bc18f33f2
--- /dev/null
+++ b/tests/global/tglobalforvar.nim
@@ -0,0 +1,9 @@
+discard """
+output: 100
+"""
+
+var funcs: seq[proc (): int {.nimcall.}] = @[]
+for i in 0..10:
+  funcs.add((proc (): int = return i * i))
+
+echo(funcs[3]())