summaryrefslogtreecommitdiff
path: root/test/files/run/t6288.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-12-12 00:01:58 +0100
committerJason Zaugg <jzaugg@gmail.com>2012-12-12 07:19:55 +0100
commit601536136e6300cb8fef8f20b1f1e74cec033621 (patch)
tree1167735759180e95103d1bd4045c1eeac5e589ca /test/files/run/t6288.scala
parent286dced26e0d12796ab183b273ce6f00da182709 (diff)
downloadscala-601536136e6300cb8fef8f20b1f1e74cec033621.tar.gz
scala-601536136e6300cb8fef8f20b1f1e74cec033621.tar.bz2
scala-601536136e6300cb8fef8f20b1f1e74cec033621.zip
Expand pattern match position tests.
- Adds tests for unapplySeq and unapply: Boolean. Both seem to be well positioned after the previous changes.
Diffstat (limited to 'test/files/run/t6288.scala')
-rw-r--r--test/files/run/t6288.scala32
1 files changed, 24 insertions, 8 deletions
diff --git a/test/files/run/t6288.scala b/test/files/run/t6288.scala
index 9d8fb990d7..cf5865e95a 100644
--- a/test/files/run/t6288.scala
+++ b/test/files/run/t6288.scala
@@ -6,14 +6,30 @@ 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) => ()
- | }
- |}""".stripMargin.trim
+ """
+ |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);