diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-29 08:03:23 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-29 08:03:23 +0000 |
commit | 74b85189b8fd792b98642859639afc5f74a8bb51 (patch) | |
tree | 275fc36973f0e9cd12e45c74d7f4e34415f036cb /test/ruby/test_module.rb | |
parent | 4cdb8fd7ec806dd7ea9417690424467b5d8a39ac (diff) | |
download | ruby-74b85189b8fd792b98642859639afc5f74a8bb51.tar.gz |
vm_insnhelper.c: fix zsuper in prepended
* 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/trunk@42724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r-- | test/ruby/test_module.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 1124101664..7d5eb99ff0 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1527,6 +1527,21 @@ class TestModule < Test::Unit::TestCase assert_nothing_raised(NoMethodError, bug8005) {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") |