summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-18 08:33:20 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-18 08:33:20 +0000
commit2103333e783b525f5d31195aa771d4bc91443e82 (patch)
treea47f517fbccb07ec92a4cf99018d9bde9e89d559 /test
parent84b49707d674097e296848de2a51789ec7842011 (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_module.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 15a39346dd9..4ca0e09277e 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -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)