From a197e61bc8068f97767a62f1bf5cf6b35ccfba86 Mon Sep 17 00:00:00 2001 From: pradel Date: Mon, 7 Apr 2008 07:04:55 +0000 Subject: test and fix for #631 --- test/files/run/t0631.check | 3 +++ test/files/run/t0631.scala | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 test/files/run/t0631.check create mode 100644 test/files/run/t0631.scala (limited to 'test/files/run') diff --git a/test/files/run/t0631.check b/test/files/run/t0631.check new file mode 100644 index 0000000000..0a7d5e4997 --- /dev/null +++ b/test/files/run/t0631.check @@ -0,0 +1,3 @@ +Foo.equals called +false +true diff --git a/test/files/run/t0631.scala b/test/files/run/t0631.scala new file mode 100644 index 0000000000..e64301e514 --- /dev/null +++ b/test/files/run/t0631.scala @@ -0,0 +1,16 @@ +object Test extends Application { + class Foo { + override def equals(that: Any) = { + println("Foo.equals called") + super.equals(that) + } + } + + println(new Foo == new Foo) + + case class Bar(x: Foo) + val b = new Bar(new Foo) + + // this should not call Foo.equals, but simply compare object identiy of b + println(b == b) +} -- cgit v1.2.3