aboutsummaryrefslogtreecommitdiff
path: root/tests/run/t0631.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/t0631.scala')
-rw-r--r--tests/run/t0631.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/run/t0631.scala b/tests/run/t0631.scala
new file mode 100644
index 000000000..2767b4bf0
--- /dev/null
+++ b/tests/run/t0631.scala
@@ -0,0 +1,16 @@
+object Test extends dotty.runtime.LegacyApp {
+ 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)
+}