diff options
Diffstat (limited to 'test/files/run/canEqualCaseClasses.scala')
-rw-r--r-- | test/files/run/canEqualCaseClasses.scala | 23 |
1 files changed, 0 insertions, 23 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))) - } -} |