mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* insns.def (invokesuper): don't skip the same class. instead, use
rb_method_entry_get_with_omod() to avoid infinite loop when super is used with refinements. [ruby-core:30450] [Bug #3351] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bea3f0df10
commit
2d3d84155d
3 changed files with 35 additions and 6 deletions
|
@ -184,4 +184,32 @@ class TestSuper < Test::Unit::TestCase
|
|||
mid.subseq
|
||||
end
|
||||
end
|
||||
|
||||
module DoubleInclude
|
||||
class Base
|
||||
def foo
|
||||
[:Base]
|
||||
end
|
||||
end
|
||||
|
||||
module Override
|
||||
def foo
|
||||
super << :Override
|
||||
end
|
||||
end
|
||||
|
||||
class A < Base
|
||||
end
|
||||
|
||||
class B < A
|
||||
end
|
||||
|
||||
B.send(:include, Override)
|
||||
A.send(:include, Override)
|
||||
end
|
||||
|
||||
# [Bug #3351]
|
||||
def test_double_include
|
||||
assert_equal([:Base, :Override, :Override], DoubleInclude::B.new.foo)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue