summary refs log tree commit diff stats
path: root/tests/vm/tcompiletimetable.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-09-05 11:56:32 +0200
committerGitHub <noreply@github.com>2019-09-05 11:56:32 +0200
commita5e2db2ac53aa61d0e050ee6487e38c647eb442d (patch)
tree5544badb2d7ad8da252e16386bdf27998d076161 /tests/vm/tcompiletimetable.nim
parent58bcf6cd46fe9108f2dced59c612153d2951aee2 (diff)
downloadNim-a5e2db2ac53aa61d0e050ee6487e38c647eb442d.tar.gz
allows access to .compileTime vars at runtime (#12128)
Diffstat (limited to 'tests/vm/tcompiletimetable.nim')
-rw-r--r--tests/vm/tcompiletimetable.nim11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/vm/tcompiletimetable.nim b/tests/vm/tcompiletimetable.nim
index e78c06536..ece2ddfe9 100644
--- a/tests/vm/tcompiletimetable.nim
+++ b/tests/vm/tcompiletimetable.nim
@@ -3,7 +3,10 @@ discard """
 3
 4:2
 Got Hi
-Got Hey'''
+Got Hey
+a
+b
+c'''
 """
 
 # bug #404
@@ -47,3 +50,9 @@ addStuff("Hey"): echo "Hey"
 addStuff("Hi"): echo "Hi"
 dump()
 
+# ensure .compileTime vars can be used at runtime:
+import macros
+
+var xzzzz {.compileTime.}: array[3, string] = ["a", "b", "c"]
+
+for i in 0..high(xzzzz): echo xzzzz[i]