summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorLemonBoy <LemonBoy@users.noreply.github.com>2018-10-09 23:24:54 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-10-09 23:24:54 +0200
commit32d5b80938daa3c4983aed5836a022804ff28cce (patch)
treeeb5f0867ba4ee1b36be92de0eaf04140fbc8b631 /tests
parent98a8868cb43efca008a909178b3475d163847833 (diff)
downloadNim-32d5b80938daa3c4983aed5836a022804ff28cce.tar.gz
Fix macro expansion in expandMacros (#8998)
* Fix macro expansion in expandMacros

Running a semanticized node trough the semantic pass was a bad idea.

Fixes #7723

* Simpler smaller implementation
Diffstat (limited to 'tests')
-rw-r--r--tests/macros/t7723.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/macros/t7723.nim b/tests/macros/t7723.nim
new file mode 100644
index 000000000..e1d0a8a8d
--- /dev/null
+++ b/tests/macros/t7723.nim
@@ -0,0 +1,19 @@
+discard """
+  msg: '''
+proc init(foo128049: int; bar128051: typedesc[int]): int =
+  foo128049
+'''
+"""
+
+import macros
+
+macro foo1(): untyped =
+  result = newStmtList()
+  result.add quote do:
+    proc init(foo: int, bar: typedesc[int]): int =
+      foo
+
+expandMacros:
+  foo1()
+
+doAssert init(1, int) == 1