From 7376ad78db80b7db04687edb3907aaa500c91c88 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 21 Nov 2012 07:37:29 +0100 Subject: [PATCH] SI-6695 Test case for fixed Array match bug --- test/files/run/t6695.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/files/run/t6695.scala diff --git a/test/files/run/t6695.scala b/test/files/run/t6695.scala new file mode 100644 index 000000000000..b527238a5193 --- /dev/null +++ b/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 + } +}