mirror of
https://github.com/ruby/ruby.git
synced 2025-09-23 20:44:00 +02:00
vm_eval.c: next super class from the original
* vm_eval.c (vm_call_super): search next super class from the original class, to get rid of infinite recursion with prepending. a patch by Seiei Higa <hanachin AT gmail.com> at [ruby-core:68434]. [ruby-core:68093] [Bug #10847] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b81950f480
commit
3e557a979e
3 changed files with 20 additions and 1 deletions
|
@ -1748,6 +1748,17 @@ class TestModule < Test::Unit::TestCase
|
|||
assert_equal([m, c2, m, c1], c2.ancestors[0, 4], "should accesisble prepended module in superclass")
|
||||
end
|
||||
|
||||
def test_prepend_call_super
|
||||
assert_separately([], <<-'end;') #do
|
||||
bug10847 = '[ruby-core:68093] [Bug #10847]'
|
||||
module M; end
|
||||
Float.prepend M
|
||||
assert_nothing_raised(SystemStackError, bug10847) do
|
||||
0.3.numerator
|
||||
end
|
||||
end;
|
||||
end
|
||||
|
||||
def test_class_variables
|
||||
m = Module.new
|
||||
m.class_variable_set(:@@foo, 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue