From: "marcandre (Marc-Andre Lafortune)" Date: 2012-05-07T08:34:58+09:00 Subject: [ruby-core:44916] [ruby-trunk - Bug #6408] DelegateClass#eql? and <=> don't work as expected Issue #6408 has been updated by marcandre (Marc-Andre Lafortune). Hi, > I was thinking that too, but the current implementation of != and == > don't do the is_a? check. Maybe those should be changed? > > Anyway, I don't know about other changes, but the failing tests I have > in this patch are causing issues for some rails users: > > https://github.com/rails/rails/issues/5974 > > I feel like we probably need better tests surrounding the "correct" > behavior of DelegateClass, but I'd rather not shave that yak at the > moment and just fix the issues we're having today. :) Sounds good. In any case, +1 from me. == and != should also be modified to call self == self and self != self in case `other.equal?(self)`, even though the only object I know of that is not == to itself is NaN... ---------------------------------------- Bug #6408: DelegateClass#eql? and <=> don't work as expected https://bugs.ruby-lang.org/issues/6408#change-26501 Author: tenderlovemaking (Aaron Patterson) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 2.0.0dev (2012-05-06 trunk 35548) [x86_64-darwin11.3.0] It seems these two methods aren't delegating to the delegate object when compared against itself. I've attached a patch with tests and a fix. It seems nobody is the maintainer for delegate.rb (according to the wiki), so if nobody objects, I will apply this patch. -- http://bugs.ruby-lang.org/