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#compare_by_identity does not work correctly when key is destructively changed #3650

mame opened this issue Feb 7, 2016 · 0 comments


Copy link

mame commented Feb 7, 2016


h = {}.compare_by_identity
a = [0]
h[a] = 42
a[0] = 1
p h[a] #=> expected: 42, actual: nil

MRI works as I expect. I confirmed this in jruby (2.2.3) 2016-01-26 7bee00d OpenJDK 64-Bit Server VM 24.95-b01 on 1.7.0_95-b00 +jit [linux-amd64].

kares added a commit to kares/jruby that referenced this issue Feb 18, 2016
@kares kares self-assigned this Feb 18, 2016
@kares kares added the core label Feb 18, 2016
@kares kares added this to the JRuby milestone Feb 18, 2016
@kares kares closed this as completed in 0285d99 Feb 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants