summary refs log tree commit diff stats
path: root/tests/accept/compile/tgenericmatcher2.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-06-15 10:15:32 +0200
committerAraq <rumpf_a@web.de>2011-06-15 10:15:32 +0200
commita15475f582e18a684c1015544b908b195f436d6d (patch)
treed3f364add28442d2627bb6aa85ccfda9f275a7c0 /tests/accept/compile/tgenericmatcher2.nim
parent4fa80956b89c2ee06d8940018101240efec7dc02 (diff)
downloadNim-a15475f582e18a684c1015544b908b195f436d6d.tar.gz
tuple unpacking is not enforced in for loops anymore
Diffstat (limited to 'tests/accept/compile/tgenericmatcher2.nim')
-rw-r--r--tests/accept/compile/tgenericmatcher2.nim18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/accept/compile/tgenericmatcher2.nim b/tests/accept/compile/tgenericmatcher2.nim
new file mode 100644
index 000000000..aa2f9dbb3
--- /dev/null
+++ b/tests/accept/compile/tgenericmatcher2.nim
@@ -0,0 +1,18 @@
+
+type
+  TMatcherKind = enum
+    mkTerminal, mkSequence, mkAlternation, mkRepeat
+  TMatcher[T] = object
+    case kind: TMatcherKind
+    of mkTerminal:
+      value: T
+    of mkSequence, mkAlternation:
+      matchers: seq[TMatcher[T]]
+    of mkRepeat:
+      matcher: ref TMatcher[T]
+      min, max: int
+
+var 
+  m: ref TMatcher[int]
+
+