Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hash code for Symbol changes across JVM invocations #5056

Closed
scabug opened this issue Oct 4, 2011 · 2 comments
Closed

Hash code for Symbol changes across JVM invocations #5056

scabug opened this issue Oct 4, 2011 · 2 comments
Assignees

Comments

@scabug
Copy link

@scabug scabug commented Oct 4, 2011

The hashCode for instances of Symbol changes across JVM invocations (similar to behavior of None in #4752). Here is what I see:


$ scala
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26).
Type in expressions to have them evaluated.
Type :help for more information.

scala> 'mysymbol.hashCode
res0: Int = 1606987090

scala> 'mysymbol.hashCode
res1: Int = 1606987090


$ scala
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26).
Type in expressions to have them evaluated.
Type :help for more information.

scala> 'mysymbol.hashCode
res0: Int = 1340276317

scala> 'mysymbol.hashCode
res1: Int = 1340276317
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 4, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5056?orig=1
Reporter: Mike Mintz (mikemintz)
Affected Versions: 2.9.1

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 5, 2011

Commit Message Bot (anonymous) said:
(extempore in r25791) Consistent hashCode for Symbol.

Use the string's hashcode so it is stable across jvm restarts.
Closes #5056, no review.

@scabug scabug closed this Oct 5, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.