ActionsLike0
Feature #7274
closedUnboundMethods should be bindable to any object that is_a?(owner of the UnboundMethod)
Description
=begin
as a corollary, (({UnboundMethod}))s referencing the same method name on the same owner, should be equal
currently (({UnboundMethod}))s 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})).
=end
Files
Updated by marcandre (Marc-Andre Lafortune) over 12 years ago
- Tracker changed from Bug to Feature
Updated by marcandre (Marc-Andre Lafortune) over 12 years ago
- Category set to core
Updated by mame (Yusuke Endoh) over 12 years ago
- Status changed from Open to Assigned
- Assignee set to matz (Yukihiro Matsumoto)
- Target version set to 2.6
Updated by marcandre (Marc-Andre Lafortune) over 11 years ago
Updated by nobu (Nobuyoshi Nakada) over 11 years ago
- Description updated (diff)
ActionsLike0