blob: cf5865e95a0ef4e5c4cf16e1ab333a905dc89a7d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
import scala.tools.partest._
import java.io.{Console => _, _}
object Test extends DirectTest {
override def extraSettings: String = "-usejavacp -Xprint:patmat -Xprint-pos -d " + testOutput.path
override def code =
"""
|object Case3 {
| def unapply(z: Any): Option[Int] = Some(-1)
|
| "" match {
| case Case3(nr) => ()
| }
|}
|object Case4 {
| def unapplySeq(z: Any): Option[List[Int]] = None
|
| "" match {
| case Case4(nr) => ()
| }
|}
|object Case5 {
| def unapply(z: Any): Boolean = true
|
| "" match {
| case Case4() => ()
| }
|}
|
|""".stripMargin.trim
override def show(): Unit = {
// Now: [84][84]Case3.unapply([84]x1);
// Was: [84][84]Case3.unapply([64]x1);
Console.withErr(System.out) {
compile()
}
}
}
|