diff options
author | LemonBoy <LemonBoy@users.noreply.github.com> | 2018-10-09 23:24:54 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-10-09 23:24:54 +0200 |
commit | 32d5b80938daa3c4983aed5836a022804ff28cce (patch) | |
tree | eb5f0867ba4ee1b36be92de0eaf04140fbc8b631 /tests | |
parent | 98a8868cb43efca008a909178b3475d163847833 (diff) | |
download | Nim-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.nim | 19 |
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 |