Actions
Bug #10826
closedRefinements make instance_methods(false) return methods of superclasses
Description
If a method is refined for a subclass X of the owner of the method,
X.instance_methods(false) returns that method even if it's not defined
in X.
class X
def foo
end
end
class Y < X
end
module Bar
refine Y do
def foo
end
end
end
p Y.instance_methods(false).include?(:foo) # false expected, but true is returned
Updated by shugo (Shugo Maeda) about 9 years ago
- Related to Bug #10765: Module#remove_method remove refined method entry. added
Updated by shugo (Shugo Maeda) about 9 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
Applied in changeset r49493.
- class.c (method_entry_i, class_instance_method_list,
rb_obj_singleton_methods): should not include methods of
superclasses if recur is false. [ruby-dev:48854] [Bug #10826]
Updated by shugo (Shugo Maeda) about 9 years ago
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED
Updated by naruse (Yui NARUSE) about 9 years ago
- Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE
ruby_2_2 r49592 merged revision(s) 49493.
Updated by usa (Usaku NAKAMURA) about 9 years ago
- Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE to 2.0.0: DONE, 2.1: REQUIRED, 2.2: DONE
ruby_2_0_0 r49738 merged revision(s) 49222,49480,49493.
Updated by nagachika (Tomoyuki Chikanaga) about 9 years ago
- Backport changed from 2.0.0: DONE, 2.1: REQUIRED, 2.2: DONE to 2.0.0: DONE, 2.1: DONE, 2.2: DONE
Backported into ruby_2_1 branch at r49992.
Actions
Like0
Like0Like0Like0Like0Like0Like0