[ruby-core:62684] [ruby-trunk - Bug #9855] [Rejected] nested hash with clone method , it act as a reference but object id are different

From: ruby-core@...
Date: 2014-05-19 20:21:03 UTC
List: ruby-core #62684
Issue #9855 has been updated by Marc-Andre Lafortune.

Status changed from Open to Rejected
Assignee deleted (Evan Phoenix)

This is expected behavior. `clone` is only a shallow clone and thus the values of a hash are not cloned themselves.

----------------------------------------
Bug #9855: nested hash with clone method , it act as a reference but object id are different 
https://bugs.ruby-lang.org/issues/9855#change-46812

* Author: Neeraj Doharey
* Status: Rejected
* Priority: High
* Assignee: 
* Category: core
* Target version: current: 2.2.0
* ruby -v: 2.1.0 , 1.9.3
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
there is a problem with nested hash , 
when i clone a nested hash it act as a reference an when i remove an element from the cloned newly created hash , the previous hash is same as newly create hash.
there object id are different
i am sending the screenshot of the problem that i face

---Files--------------------------------
Screen Shot 2014-05-19 at 10.54.18 pm.png (431 KB)


-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next