Actions
Bug #20307
closed`Hash#update` from compare_by_identity hash can have unfrozen string keys
Description
I don't think this behavior is expected.
i = Hash.new.compare_by_identity
k = "a"
i[k] = 0
h = {}.update(i)
p h.compare_by_identity? # => false
p h["a"] # => 0
k.upcase!
# `k` is still in `h`.
p h.keys.include?(k) # => true
# but not found.
p((h.fetch(k) rescue $!)) # => #<KeyError: key not found: "A">
h["A"] = 1
p h # => {"A"=>0, "A"=>1}
I expect h
to still have "a"=>0
entry.
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0