Issue #5185 has been updated by Arnau Sanchez.


+1, I just got bitten by this. Hash#merge returns a new object, so one should expect Set#merge to behave the same way (Principle of Least Surprise). 

Set#merge! and Set#update for in-places unions both sound good to me. 
----------------------------------------
Feature #5185: Set#merge acts in place but Hash#merge does not
https://bugs.ruby-lang.org/issues/5185

Author: Thomas Sawyer
Status: Open
Priority: Normal
Assignee: 
Category: lib
Target version: 2.0.0


Waste of brain cells to have to learn and recall they are different. The expected method would be Set#merge!, Set#merge would return a new Set instance.

OTOH, why not Set#concat ? Or conversely, Array#merge ?




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