Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Array#uniq behavior differs from MRI with BasicObject members #3227
A class that extends BasicObject and implements ==, eql?, and hash fails to match against others in Array#uniq.
As a result,
Test case follows:
Ok, the basic issue is that we don't override Object#hashCode or #equals on RubyBasicObject, so they never attempt to dispatch back into Ruby. Since our Hash impl uses those methods, this is obviously not right.
I have a patch that moves #hashCode and #equals up from RubyObject and introduces "checked" calling of them, but it's a little scary. We may want to keep the RubyObject versions around.