summaryrefslogtreecommitdiff
path: root/test/files/run/patmatnew.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/patmatnew.scala')
-rw-r--r--test/files/run/patmatnew.scala21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala
index 51c823f7ac..6ec3928757 100644
--- a/test/files/run/patmatnew.scala
+++ b/test/files/run/patmatnew.scala
@@ -823,6 +823,27 @@ object Test extends TestConsoleMain {
}
}
}
+
+ object Ticket522 { // compile-only
+ class Term[X]
+ object App {
+ // i'm hidden
+ case class InternalApply[Y,Z](fun:Y=>Z, arg:Y) extends Term[Z]
+
+ def apply[Y,Z](fun:Y=>Z, arg:Y): Term[Z] =
+ new InternalApply[Y,Z](fun,arg)
+
+ def unapply[X](arg: Term[X]): Option[(Y=>Z,Y)] forSome {type Y; type Z} =
+ arg match {
+ case i:InternalApply[y,z] => Some(i.fun, i.arg)
+ case _ => None
+ }
+ }
+
+ App({x: Int => x}, 5) match {
+ case App(arg, a) =>
+ }
+ } // end Ticket522
}