diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t0631.check | 3 | ||||
-rw-r--r-- | test/files/run/t0631.scala | 16 |
2 files changed, 19 insertions, 0 deletions
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) +} |