diff options
author | Burak Emir <emir@epfl.ch> | 2007-08-21 21:49:23 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2007-08-21 21:49:23 +0000 |
commit | e313d9651adc2b7137a1dabbd3b0351619383035 (patch) | |
tree | bb43d9b9470dba4bea72b6df00b35739de6be358 /test | |
parent | 1e350595d8ad8a30234750da25a1718235547202 (diff) | |
download | scala-e313d9651adc2b7137a1dabbd3b0351619383035.tar.gz scala-e313d9651adc2b7137a1dabbd3b0351619383035.tar.bz2 scala-e313d9651adc2b7137a1dabbd3b0351619383035.zip |
fixed #1281, reverted Sean's lazy generator in ...
fixed #1281, reverted Sean's lazy generator in Main which broke the
build
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/patmatnew.scala | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala index f183fc11ec..14e349b847 100644 --- a/test/files/run/patmatnew.scala +++ b/test/files/run/patmatnew.scala @@ -394,5 +394,27 @@ object Test extends TestConsoleMain { } } + object cast2 { // #1281 + + class Sync { + def unapplySeq(scrut: Int): Option[Seq[Int]] = { + println("unapplySeq: "+scrut) + if (scrut == 42) Some(List(1, 2)) + else None + } + } + + class Buffer { + val Get = new Sync + + val jp: PartialFunction[Any, Any] = { + case Get(xs) => println(xs) // the argDummy <unapply-selector> should have proper arg.tpe (Int in this case) + } + } + + println((new Buffer).jp.isDefinedAt(40)) + println((new Buffer).jp.isDefinedAt(42)) + } + } |