Issue #7274 has been updated by marcandre (Marc-Andre Lafortune).

Category set to core

I agree.

Quite simple: https://github.com/marcandre/ruby/compare/marcandre:trunk...marcandre:bind_with_owner
Diff: https://github.com/marcandre/ruby/compare/marcandre:trunk...marcandre:bind_with_owner.diff

note that `make test` and `test-all` already pass with your proposed behavior. I see no reason why this could cause an incompatibility either.

Moving to "feature", as the current behavior is intended, as the current doc shows.

If this behavior is accepted, we could also revisit the `==` (and the `inspect` method too), as where the method was taken would become irrelevant, only the point of definition would be important. I believe this should be the case too.

Any objection for `bind` to use the actual owner?
----------------------------------------
Feature #7274: UnboundMethods should be bindable  to any object that is_a?(owner of the UnboundMethod)
https://bugs.ruby-lang.org/issues/7274#change-32351

Author: rits (First Last)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 


as a corollary, UnboundMethods referencing the same method name on the same owner, should be equal

currently UnboundMethods binding is determined by the class via which they were retrieved, not the owner
____________________________________
class Base; def foo; end end
class Sub < Base; end

base_foo = Base.instance_method :foo
sub_foo = Sub.instance_method :foo
sub_foo.bind(Base.new).call
__________________________________

sub_foo.owner is Base so there does not seem to be any reason why it's not safe for it to bind to an instance of Base.

and there does not seem to be any reason for sub_foo and base_foo to be unequal, they both refer to the same method, foo on Base.


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