2
0
Simon Krajewski 11 жил өмнө
parent
commit
cc4ce36b11

+ 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):
+			}
+		));
+	}
+
+}