mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-15 15:44:14 +00:00
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
This commit is contained in:
19
tests/macros/t7723.nim
Normal file
19
tests/macros/t7723.nim
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user