diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/canEqualCaseClasses.scala | 23 | ||||
-rw-r--r-- | test/files/run/caseclasses.scala | 6 | ||||
-rw-r--r-- | test/files/run/patmatnew.scala | 2 | ||||
-rw-r--r-- | test/files/run/t0607.scala | 6 | ||||
-rwxr-xr-x | test/files/run/t0883.scala | 3 |
5 files changed, 6 insertions, 34 deletions
diff --git a/test/files/run/canEqualCaseClasses.scala b/test/files/run/canEqualCaseClasses.scala deleted file mode 100644 index b1c3eb91de..0000000000 --- a/test/files/run/canEqualCaseClasses.scala +++ /dev/null @@ -1,23 +0,0 @@ -object Test { - case class Foo(x: Int) - case class Bar(y: Int) extends Foo(y) - case class Nutty() { - override def canEqual(other: Any) = true - } - - def assertEqual(x: AnyRef, y: AnyRef) = - assert((x == y) && (y == x) && (x.hashCode == y.hashCode)) - - def assertUnequal(x: AnyRef, y: AnyRef) = - assert((x != y) && (y != x)) - - def main(args: Array[String]): Unit = { - assertEqual(Foo(5), Foo(5)) - assertEqual(Bar(5), Bar(5)) - assertUnequal(Foo(5), Bar(5)) - - // in case there's an overriding implementation - assert(Nutty() canEqual (new AnyRef)) - assert(!(Foo(5) canEqual (new AnyRef))) - } -} diff --git a/test/files/run/caseclasses.scala b/test/files/run/caseclasses.scala index 56fe6dad96..ed5643a709 100644 --- a/test/files/run/caseclasses.scala +++ b/test/files/run/caseclasses.scala @@ -2,8 +2,6 @@ case class Foo(x: Int)(y: Int) case class Bar -case class Baz(override val x: Int, y: Int) extends Foo(x)(y) - abstract class Base abstract case class Abs(x: Int) extends Base @@ -30,10 +28,6 @@ object Test extends Application { case Foo(1) => Console.println("OK") case Bar() => Console.println("NO") } - (Baz(1, 2): AnyRef) match { - case Baz(1, 2) => ; - case Bar() => Console.println("NO") - } try { Bar() productElement 3 throw new NullPointerException("duh") diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala index 34bd024b29..c78fceb96b 100644 --- a/test/files/run/patmatnew.scala +++ b/test/files/run/patmatnew.scala @@ -928,7 +928,7 @@ override def runTest() { object Ticket710 { // compile-only def method { - sealed case class Parent() + sealed class Parent() case object Child extends Parent() val x: Parent = Child x match { diff --git a/test/files/run/t0607.scala b/test/files/run/t0607.scala index afc7ff9b46..5601494dec 100644 --- a/test/files/run/t0607.scala +++ b/test/files/run/t0607.scala @@ -1,7 +1,7 @@ object Test extends Application { - case class A - case class B extends A + case class A() + class B extends A() { override def toString() = "B()" } println(A()) - println(B()) + println(new B()) } diff --git a/test/files/run/t0883.scala b/test/files/run/t0883.scala index 5cd4418f5b..b9d71702d8 100755 --- a/test/files/run/t0883.scala +++ b/test/files/run/t0883.scala @@ -1,4 +1,5 @@ -case class Foo(name: String) +object Foo { def apply(x: String) = new Foo(x) } +class Foo(name: String) case object Bar extends Foo("Bar") case class Baz extends Foo("Baz") object Test extends Application { |