summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-07-09 15:07:05 +0000
committerPaul Phillips <paulp@improving.org>2009-07-09 15:07:05 +0000
commitccfb3b9c1697379335992b085368557297c72e2d (patch)
tree05b073fe8ec7d0330308c84fc48f3a673aa842dd /test
parent1901250eef5d59d05b9f2a26b0e0d6bca6e73f19 (diff)
downloadscala-ccfb3b9c1697379335992b085368557297c72e2d.tar.gz
scala-ccfb3b9c1697379335992b085368557297c72e2d.tar.bz2
scala-ccfb3b9c1697379335992b085368557297c72e2d.zip
The presently salvageable portion of my attempt...
The presently salvageable portion of my attempt to fix bugs #425 and #816 (which I have indeed fixed, but a bazillion other test cases broke so the fix is commented out until I can make everyone happy at once.)
Diffstat (limited to 'test')
-rw-r--r--test/pending/run/bugs425-and-816.scala41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/pending/run/bugs425-and-816.scala b/test/pending/run/bugs425-and-816.scala
new file mode 100644
index 0000000000..eb44787a72
--- /dev/null
+++ b/test/pending/run/bugs425-and-816.scala
@@ -0,0 +1,41 @@
+object Test {
+ object bug816 {
+ abstract class Atest(val data: String)
+ case class Btest(override val data: String, val b: Boolean) extends Atest(data)
+ case class Ctest(override val data: String) extends Btest(data, true)
+
+ class testCaseClass {
+ def test(x: Atest) = x match {
+ case Ctest(data) => "C"
+ case Btest(data, b) => "B"
+ }
+ }
+ def go() = {
+ val tcc = new testCaseClass()
+
+ tcc.test(Ctest("foo")) + tcc.test(Btest("bar", true))
+ }
+ }
+
+ object bug425 {
+ case class A(x: Int)
+ case class B(override val x: Int, y: Double) extends A(x)
+
+ val b: A = B(5, 3.3)
+ def flail = b match {
+ case B(x, y) => "B"
+ case A(x) => "A"
+ }
+ def flail2 = (B(10, 5.5): Any) match {
+ case A(20) => "1"
+ case A(10) => "2"
+ case _ => "fail"
+ }
+ def go() = flail + flail2
+ }
+
+ def main(args: Array[String]): Unit = {
+ assert(bug816.go() == "CB")
+ assert(bug425.go() == "B2")
+ }
+} \ No newline at end of file