summary refs log tree commit diff stats
path: root/tests/vm/tforwardproc.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vm/tforwardproc.nim')
-rw-r--r--tests/vm/tforwardproc.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/vm/tforwardproc.nim b/tests/vm/tforwardproc.nim
new file mode 100644
index 000000000..bcd929f0e
--- /dev/null
+++ b/tests/vm/tforwardproc.nim
@@ -0,0 +1,17 @@
+discard """
+  errormsg: "cannot evaluate at compile time: initArray"
+  line: 11
+"""
+
+# bug #3066
+
+proc initArray(): array[10, int]
+
+const
+  someTable = initArray()
+
+proc initArray(): array[10, int] =
+  for f in 0..<10:
+    result[f] = 3
+
+when true: echo repr(someTable)