diff options
Diffstat (limited to 'test/pending/run')
-rw-r--r-- | test/pending/run/bugs425-and-816.scala | 46 | ||||
-rw-r--r-- | test/pending/run/t2005.scala | 24 |
2 files changed, 16 insertions, 54 deletions
diff --git a/test/pending/run/bugs425-and-816.scala b/test/pending/run/bugs425-and-816.scala index 4e841ccc31..d9267d06af 100644 --- a/test/pending/run/bugs425-and-816.scala +++ b/test/pending/run/bugs425-and-816.scala @@ -1,41 +1,27 @@ 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" + b match { + case B(x, y) => Console.println(y) + case A(x) => Console.println(x) } - 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") + 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) => Console.println("C") + case Btest(data, b) => Console.println("B") + } + } } } diff --git a/test/pending/run/t2005.scala b/test/pending/run/t2005.scala deleted file mode 100644 index 8e4243a768..0000000000 --- a/test/pending/run/t2005.scala +++ /dev/null @@ -1,24 +0,0 @@ -Object Bug { - def main(args: Array[String]) { - val a = new Array[Array[Int]](2,2) - test(a) - } - def test[A](t: Array[Array[A]]) { - val tmp = t(0) - t(1) = tmp - } -} -java.lang.ArrayStoreException: scala.runtime.BoxedIntArray - at scala.runtime.BoxedObjectArray.update(BoxedObjectArray.scala:26) - at Bug$.test(Bug.scala:12) - at Bug$.main(Bug.scala:7) - at Bug.main(Bug.scala) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at scala.tools.nsc.ObjectRunner$$anonfun$run$1.apply(ObjectRunner.scala:75) - at scala.tools.nsc.ObjectRunner$.withContextClassLoader(ObjectRunner.scala:49) - at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:74) - at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:154) - at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala) |