diff options
author | pradel <pradel@epfl.ch> | 2008-04-07 07:04:55 +0000 |
---|---|---|
committer | pradel <pradel@epfl.ch> | 2008-04-07 07:04:55 +0000 |
commit | a197e61bc8068f97767a62f1bf5cf6b35ccfba86 (patch) | |
tree | 5eaeda1bd29859040f9fae9f7b25f546fd68102c /test | |
parent | b6f12c08007eb558bffe6fd89a8aad3b2fab27f3 (diff) | |
download | scala-a197e61bc8068f97767a62f1bf5cf6b35ccfba86.tar.gz scala-a197e61bc8068f97767a62f1bf5cf6b35ccfba86.tar.bz2 scala-a197e61bc8068f97767a62f1bf5cf6b35ccfba86.zip |
test and fix for #631
Diffstat (limited to 'test')
-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) +} |