Files
Nim/tests/macros/tbindsym.nim
2017-07-25 09:28:23 +02:00

26 lines
341 B
Nim

discard """
output: '''TFoo
TBar'''
"""
# bug #1319
import macros
type
TTextKind = enum
TFoo, TBar
macro test: untyped =
var x = @[TFoo, TBar]
result = newStmtList()
for i in x:
result.add newCall(newIdentNode("echo"),
case i
of TFoo:
bindSym("TFoo")
of TBar:
bindSym("TBar"))
test()