fixes #1319
This commit is contained in:
parent
b89495ef0f
commit
0339b9d386
2 changed files with 29 additions and 1 deletions
25
tests/macros/tbindsym.nim
Normal file
25
tests/macros/tbindsym.nim
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
discard """
|
||||
output: '''TFoo
|
||||
TBar'''
|
||||
"""
|
||||
|
||||
# bug #1319
|
||||
|
||||
import macros
|
||||
|
||||
type
|
||||
TTextKind = enum
|
||||
TFoo, TBar
|
||||
|
||||
macro test: stmt =
|
||||
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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue