From a3f791f8929871b9e20f2fd4d69571dd20b3c409 Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 14 Sep 2015 12:42:22 +0200 Subject: [PATCH] added testcase for #1679 --- tests/ccgbugs/tnocodegen_for_compiletime.nim | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/ccgbugs/tnocodegen_for_compiletime.nim diff --git a/tests/ccgbugs/tnocodegen_for_compiletime.nim b/tests/ccgbugs/tnocodegen_for_compiletime.nim new file mode 100644 index 0000000000..a88ba4b325 --- /dev/null +++ b/tests/ccgbugs/tnocodegen_for_compiletime.nim @@ -0,0 +1,9 @@ +# bug #1679 +import macros, tables, hashes +proc hash(v: NimNode): Hash = 4 # performance is for suckers +macro test(body: stmt): stmt {.immediate.} = + var a = initCountTable[NimNode]() + a.inc(body) + +test: + 1 + 1