diff options
author | Burak Emir <emir@epfl.ch> | 2006-07-12 14:30:47 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2006-07-12 14:30:47 +0000 |
commit | bafe0251286459b2b2259eba1a7d6dabf1c41f72 (patch) | |
tree | 5a44dc0f6fa2f0d2325c02e1a4b7e70a17b10993 /test/files/run | |
parent | 4080a760cb70b131a6e932cb93a75a7bea4c725e (diff) | |
download | scala-bafe0251286459b2b2259eba1a7d6dabf1c41f72.tar.gz scala-bafe0251286459b2b2259eba1a7d6dabf1c41f72.tar.bz2 scala-bafe0251286459b2b2259eba1a7d6dabf1c41f72.zip |
more fix, more optimization
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/regularpatmatnew.scala | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/files/run/regularpatmatnew.scala b/test/files/run/regularpatmatnew.scala index 444b36e32f..617293028c 100644 --- a/test/files/run/regularpatmatnew.scala +++ b/test/files/run/regularpatmatnew.scala @@ -8,7 +8,8 @@ object Test { new Test01, new Test02, new Test03, - new Test04 + new Test04, + new Test05 ).run(tr) @@ -95,5 +96,18 @@ object Test { } } + class Test05 extends TestCase("cinque (sealed case class with ignoring seq patterns)") { + sealed abstract class Con; + + case class Foo() extends Con + case class Bar(xs:Con*) extends Con + + override def runTest() = { + val res = (Bar(Foo()):Con) match { + case Bar(xs@_*) => xs // this should be optimized away to a pattern Bar(xs) + } + assertEquals("res instance"+res.isInstanceOf[Seq[Con]]+" res(0)="+res(0), true, res.isInstanceOf[Seq[Foo]] && res(0) == Foo() ) + } + } } |