We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 48b7dbb commit 6999ca8Copy full SHA for 6999ca8
tests/neg/i4984.scala
@@ -0,0 +1,26 @@
1
+object Array2 {
2
+ def unapplySeq(x: Array[Int]): Data = new Data
3
+
4
+ final class Data {
5
+ def isEmpty: Boolean = false
6
+ def get: Data = this
7
+ def lengthCompare(len: Int): Int = 0
8
+ def apply(i: Int): Int = 3
9
+ def drop(n: Int): scala.Seq[String] = Seq("hello")
10
+ def toSeq: scala.Seq[Int] = Seq(6, 7)
11
+ }
12
+}
13
14
+object Test {
15
+ def test1(xs: Array[Int]): Int = xs match {
16
+ case Array2(x, y) => x + y // error // error
17
18
19
+ def test2(xs: Array[Int]): Seq[Int] = xs match {
20
+ case Array2(x, y, xs:_*) => xs // error
21
22
23
+ def test3(xs: Array[Int]): Seq[Int] = xs match {
24
+ case Array2(xs:_*) => xs // error
25
26
0 commit comments