Project

General

Profile

Actions

Bug #10023

closed

Hash#merge fails duplicating objects

Added by coyote (Alexey Babich) over 10 years ago. Updated over 10 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
2.1.2
[ruby-core:63629]

Description

Here is an example in IRB (ruby 2.1.2):

A={b:{}}
=> {:b=>{}}
c=A.merge({c: {d: 'e'}})
=> {:b=>{}, :c=>{:d=>"e"}}
c[:b][:d] = "f"
=> "f"
A
=> {:b=>{:d=>"f"}}

Every key, value pair is expected to be duplicated during the merge? Please, investigate if this is a bug

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0