From e301285d4ca7f173dced08f54994f977f8b8347f Mon Sep 17 00:00:00 2001 From: flywind <43030857+xflywind@users.noreply.github.com> Date: Fri, 30 Oct 2020 17:00:25 +0800 Subject: [PATCH] closes #6036 (#15779) * add testcase for #6036 * try * try again * make it work (cherry picked from commit 4374c638cd328b8cf9b72ff756cfe0564d6d9c78) --- tests/ccgbugs/tcompile_time_var_at_runtime.nim | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/ccgbugs/tcompile_time_var_at_runtime.nim diff --git a/tests/ccgbugs/tcompile_time_var_at_runtime.nim b/tests/ccgbugs/tcompile_time_var_at_runtime.nim new file mode 100644 index 0000000000..c0de0390b4 --- /dev/null +++ b/tests/ccgbugs/tcompile_time_var_at_runtime.nim @@ -0,0 +1,11 @@ +discard """ + output: "1\n2\n2\n3" +""" +var a {.compileTime.} = 1 + +echo a +a = 2 +echo a +echo a +a = 3 +echo a \ No newline at end of file