Skip to content

Hash#compare_by_identity does not work correctly when key is destructively changed #3650

@mame

Description

@mame

Hello,

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 9.0.5.0 (2.2.3) 2016-01-26 7bee00d OpenJDK 64-Bit Server VM 24.95-b01 on 1.7.0_95-b00 +jit [linux-amd64].

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions