diff options
author | Araq <rumpf_a@web.de> | 2011-03-07 00:33:43 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-03-07 00:33:43 +0100 |
commit | f9c6cec90c1a67e885b6172a8bccfb014175f60b (patch) | |
tree | dc6e8eef96705490238e58ca845c60fec3aa313d /tests/accept/compile | |
parent | 3005955d20033db12345eacd6eb8ff8cec92507c (diff) | |
download | Nim-f9c6cec90c1a67e885b6172a8bccfb014175f60b.tar.gz |
bugfix: tuple access in macros (issue #17)
Diffstat (limited to 'tests/accept/compile')
-rw-r--r-- | tests/accept/compile/tmacro1.nim | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/accept/compile/tmacro1.nim b/tests/accept/compile/tmacro1.nim new file mode 100644 index 000000000..e96997c47 --- /dev/null +++ b/tests/accept/compile/tmacro1.nim @@ -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" + |