summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
Diffstat (limited to 'test/files')
-rw-r--r--test/files/run/regularpatmat.check1
-rw-r--r--test/files/run/regularpatmat.scala28
2 files changed, 28 insertions, 1 deletions
diff --git a/test/files/run/regularpatmat.check b/test/files/run/regularpatmat.check
index cc902ea473..ad48fcaf98 100644
--- a/test/files/run/regularpatmat.check
+++ b/test/files/run/regularpatmat.check
@@ -118,3 +118,4 @@ passed ok
passed ok
passed ok
passed ok
+testBugSequenceApply hello hello \ No newline at end of file
diff --git a/test/files/run/regularpatmat.scala b/test/files/run/regularpatmat.scala
index b5c345cf2d..8d4bb00b6e 100644
--- a/test/files/run/regularpatmat.scala
+++ b/test/files/run/regularpatmat.scala
@@ -20,7 +20,7 @@ object Test {
testBO.main( args );
testMZ.main;
//testNN.main;
- ()
+ testBugSequenceApply.main;
}
}
@@ -716,3 +716,29 @@ object testNO { // this does not need to be run, only compiled
}
+
+/** see comments in scala.tools.scalac.transformer.matching.PatternMatcher::isSeqApply 2005-02-17
+ */
+object testBugSequenceApply {
+
+ val x = List(1,2,3);
+
+ case class ThreeBars extends Seq[Int] {
+ override def length = 3;
+ def elements = x.elements;
+ def apply(i:Int) = x.apply(i);
+ }
+
+ // this works
+ def main:Unit = {
+ Console.print("testBugSequenceApply ");
+ val z: Seq[Int] = new ThreeBars();
+ Console.print(z.match {
+ case Seq(1,2,3) => "hello" // but ThreeBars is a case class...
+ });
+
+ Console.print(ThreeBars().match {
+ case Seq(1,2,3) => " hello" // but ThreeBars is a case class...
+ });
+ }
+}