bugfix: tuple access in macros (issue #17)
This commit is contained in:
parent
3005955d20
commit
f9c6cec90c
2 changed files with 56 additions and 9 deletions
21
tests/accept/compile/tmacro1.nim
Normal file
21
tests/accept/compile/tmacro1.nim
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import macros
|
||||
|
||||
macro test*(a: stmt): stmt =
|
||||
var nodes: tuple[a, b: int]
|
||||
nodes.a = 4
|
||||
nodes[1] = 45
|
||||
|
||||
type
|
||||
TTypeEx = object
|
||||
x, y: int
|
||||
case b: bool
|
||||
of false: nil
|
||||
of true: z: float
|
||||
|
||||
var t: TTypeEx
|
||||
t.b = true
|
||||
t.z = 4.5
|
||||
|
||||
test:
|
||||
"hi"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue