Bug #10706 » 0001-vm_method.c-fix-change-refined-new-method-visibility.patch
| test/ruby/test_refinement.rb | ||
|---|---|---|
|
end;
|
||
|
end
|
||
|
def test_change_refined_new_method_visibility
|
||
|
assert_separately([], <<-"end;")
|
||
|
bug10706 = '[ruby-core:67387] [Bug #10706]'
|
||
|
module RefinementBug
|
||
|
refine Object do
|
||
|
def foo
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
assert_raise(NameError, bug10706) {private(:foo)}
|
||
|
end;
|
||
|
end
|
||
|
private
|
||
|
def eval_using(mod, s)
|
||
| vm_method.c | ||
|---|---|---|
|
me = search_method(rb_cObject, name, &defined_class);
|
||
|
}
|
||
|
if (UNDEFINED_METHOD_ENTRY_P(me)) {
|
||
|
if (UNDEFINED_METHOD_ENTRY_P(me) ||
|
||
|
(me->def->type == VM_METHOD_TYPE_REFINED &&
|
||
|
UNDEFINED_METHOD_ENTRY_P(me->def->body.orig_me))) {
|
||
|
rb_print_undef(klass, name, 0);
|
||
|
}
|
||
- « Previous
- 1
- 2
- 3
- Next »