Browse Source

add test for issue #2508

Simon Krajewski 11 years ago
parent
commit
cc4ce36b11
1 changed files with 20 additions and 0 deletions
  1. 20 0
      tests/unit/issues/Issue2508.hx

+ 20 - 0
tests/unit/issues/Issue2508.hx

@@ -0,0 +1,20 @@
+package unit.issues;
+
+enum Tree<T> {
+    Leaf(v:T);
+    Node(l:Tree<T>, r:Tree<T>);
+}
+
+class Issue2508 extends unit.Test {
+
+	public function test() {
+		t(unit.TestType.typeError(
+			switch(Leaf("foo")) {
+				case Leaf(_)
+				   | Leaf("foo"): // This pattern is unused
+				case Node(l,r):
+			}
+		));
+	}
+
+}