Actions
Bug #14008
closedAdding elements to array inside 2D array duplicates across all other arrays
Bug #14008:
Adding elements to array inside 2D array duplicates across all other arrays
Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
Backport:
Description
Say I create a 2D array in Ruby using the Array.new syntax like this:
arr = Array.new 3, []
Adding elements to say, the 2nd array inside arr produces the following result:
Expected behavior¶
I think this should work exactly like what happens when initializing 2D arrays using the literal syntax:
Updated by v0dro (Sameer Deshmukh) almost 9 years ago
I'm so sorry I had forgotten about Array gotchas. Please close this issue.
Updated by duerst (Martin Dürst) almost 9 years ago
- Status changed from Open to Rejected
Actions