Skip to content
Browse files

SI-6695 Test case for fixed Array match bug

  • Loading branch information...
1 parent 6cb08a1 commit 7376ad78db80b7db04687edb3907aaa500c91c88 @retronym retronym committed Nov 21, 2012
Showing with 18 additions and 0 deletions.
  1. +18 −0 test/files/run/t6695.scala
View
18 test/files/run/t6695.scala
@@ -0,0 +1,18 @@
+object Test extends App {
+ try {
+ Array("a", "b", "c") match {
+ case Array("a", "x", "c") => println("x")
+ case Array("a", "b", "x") => println("a");
+ case Array("a", "d", _*) => println("wrongly positive")
+ }
+ assert(false, "match succeeded")
+ } catch {
+ case _: MatchError => // okay
+ }
+
+ Array("a", "b", "c") match {
+ case Array("a", "x", "c") => println("x")
+ case Array("a", "b", "x") => println("a");
+ case Array("a", "b", _*) => // okay
+ }
+}

0 comments on commit 7376ad7

Please sign in to comment.
Something went wrong with that request. Please try again.