mirror of
https://github.com/ruby/ruby.git
synced 2025-09-23 20:44:00 +02:00
should use defined_class.
* vm_insnhelper.c (vm_call_method_each_type): we should use me->defined_class instead of me->owner because me->owner doesn't has correct ancestors list. [Bug #15427] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
84b49707d6
commit
2103333e78
2 changed files with 19 additions and 1 deletions
|
@ -2352,6 +2352,24 @@ class TestModule < Test::Unit::TestCase
|
|||
end;
|
||||
end
|
||||
|
||||
def test_private_extended_module
|
||||
assert_separately [], %q{
|
||||
class Object
|
||||
def bar; "Object#bar"; end
|
||||
end
|
||||
module M1
|
||||
def bar; super; end
|
||||
end
|
||||
module M2
|
||||
include M1
|
||||
private(:bar)
|
||||
def foo; bar; end
|
||||
end
|
||||
extend M2
|
||||
assert_equal 'Object#bar', foo
|
||||
}
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def assert_top_method_is_private(method)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue