diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-09-05 11:56:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-05 11:56:32 +0200 |
commit | a5e2db2ac53aa61d0e050ee6487e38c647eb442d (patch) | |
tree | 5544badb2d7ad8da252e16386bdf27998d076161 /tests/vm/tcompiletimetable.nim | |
parent | 58bcf6cd46fe9108f2dced59c612153d2951aee2 (diff) | |
download | Nim-a5e2db2ac53aa61d0e050ee6487e38c647eb442d.tar.gz |
allows access to .compileTime vars at runtime (#12128)
Diffstat (limited to 'tests/vm/tcompiletimetable.nim')
-rw-r--r-- | tests/vm/tcompiletimetable.nim | 11 |
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] |