summary refs log tree commit diff stats
path: root/tests/accept/compile
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-03-07 00:33:43 +0100
committerAraq <rumpf_a@web.de>2011-03-07 00:33:43 +0100
commitf9c6cec90c1a67e885b6172a8bccfb014175f60b (patch)
treedc6e8eef96705490238e58ca845c60fec3aa313d /tests/accept/compile
parent3005955d20033db12345eacd6eb8ff8cec92507c (diff)
downloadNim-f9c6cec90c1a67e885b6172a8bccfb014175f60b.tar.gz
bugfix: tuple access in macros (issue #17)
Diffstat (limited to 'tests/accept/compile')
-rw-r--r--tests/accept/compile/tmacro1.nim21
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"
+