From 4374c638cd328b8cf9b72ff756cfe0564d6d9c78 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: closes #6036 (#15779) * add testcase for #6036 * try * try again * make it work --- 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 (limited to 'tests') 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 000000000..c0de0390b --- /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 -- cgit 1.4.1-2-gfad0