diff options
author | Burak Emir <emir@epfl.ch> | 2008-04-07 01:37:29 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2008-04-07 01:37:29 +0000 |
commit | fbd2b0caac60c33408c0dd1906855617c4e188fb (patch) | |
tree | fa1a248f16f7e62fc363348c8a235e6d224985f8 /test | |
parent | c04fa9cd2214689620cacfc6c9ddbf1634942a95 (diff) | |
download | scala-fbd2b0caac60c33408c0dd1906855617c4e188fb.tar.gz scala-fbd2b0caac60c33408c0dd1906855617c4e188fb.tar.bz2 scala-fbd2b0caac60c33408c0dd1906855617c4e188fb.zip |
fixed #522
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/patmatnew.scala | 21 |
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 } |