Files
Nim/tests/msgs/texpandmacro.nim
Jake Leahy f80ce139d5 Make expandMacro show private fields (#24522)
Was debugging with `--expandMacro` and noticed that private fields
weren't exported.
Passes extra flags to the renderer to make them be shown
2024-12-17 18:17:04 +01:00

25 lines
406 B
Nim

discard """
cmd: "nim c --expandMacro:foo $file"
nimout: '''texpandmacro.nim(20, 1) Hint: expanded macro:
echo ["injected echo"]
var x = 4
type
Hello = object
private: string [ExpandMacro]
'''
output: '''injected echo'''
"""
import macros
macro foo(x: untyped): untyped =
result = quote do:
echo "injected echo"
`x`
foo:
var x = 4
type
Hello = object
private: string