summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library/scala/Symbol.scala8
-rwxr-xr-xtest/files/jvm/serialization.check2
2 files changed, 3 insertions, 7 deletions
diff --git a/src/library/scala/Symbol.scala b/src/library/scala/Symbol.scala
index 5ab9ec680a..dd9bfabbf8 100644
--- a/src/library/scala/Symbol.scala
+++ b/src/library/scala/Symbol.scala
@@ -39,12 +39,8 @@ final class Symbol private (val name: String) {
*/
override def toString(): String = "'" + name
- /** Compares this symbol with the specified value for equality.
- */
- override def equals(that: Any): Boolean = that match {
- case that: Symbol => this.name == that.name
- case _ => false
- }
+ @throws(classOf[java.io.ObjectStreamException])
+ private def readResolve(): Any = Symbol.apply(name)
}
object Symbol {
diff --git a/test/files/jvm/serialization.check b/test/files/jvm/serialization.check
index 813cf19594..c9e65e9ac1 100755
--- a/test/files/jvm/serialization.check
+++ b/test/files/jvm/serialization.check
@@ -16,7 +16,7 @@ x4(2): 4 - y4(2): 4
x5 = 'hello
y5 = 'hello
-x5 eq y5: false - y5 eq x5: false
+x5 eq y5: true - y5 eq x5: true
x5 equals y5: true - y5 equals x5: true
x = List((buffers,20), (layers,2), (title,3))