summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-29 12:50:38 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-29 12:50:38 +0000
commit6588ba877a54e42a3f5d27b44d7ee500fd868243 (patch)
treeff5b625f96feeaa6914d8f055f204de4fcf2c08f /test
parent335a9ef2f8acd966fd4f70281584e1c2258e4664 (diff)
merge revision(s) 42724: [Backport #8238]
* vm_insnhelper.c (vm_call_method): a method entry refers the based class/module, so should search superclass from the origin i-class where the entry belongs to, to get rid of infinite loop when zsuper in a prepended class/module. [ruby-core:54105] [Bug #8238] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@42726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_module.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 1239711756..915a1b9feb 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -1525,6 +1525,21 @@ class TestModule < Test::Unit::TestCase
assert_nothing_raised(NoMethodError) {a.send :foo}
end
+ def test_prepend_visibility_inherited
+ bug8238 = '[ruby-core:54105] [Bug #8238]'
+ assert_separately [], <<-"end;", timeout: 3
+ class A
+ def foo() A; end
+ private :foo
+ end
+ class B < A
+ public :foo
+ prepend Module.new
+ end
+ assert_equal(A, B.new.foo, "#{bug8238}")
+ end;
+ end
+
def test_prepend_included_modules
bug8025 = '[ruby-core:53158] [Bug #8025]'
mixin = labeled_module("mixin")