diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-19 01:27:52 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-02-19 01:27:52 +0000 |
commit | 4d47e8d99321194aa3782bd40baf15ae5f36ebaa (patch) | |
tree | c206d8f5666907abb3f3b47961d5860b0466176c /test | |
parent | 7e5140e285c3aa59c423e7091fe6cb3e7172d0bd (diff) | |
download | ruby-4d47e8d99321194aa3782bd40baf15ae5f36ebaa.tar.gz |
vm_insnhelper.c: super to module in refinement
* vm_insnhelper.c (vm_call_zsuper): method defined in module in
refinement is not callable as-is. dispatch again.
[ruby-core:79588] [Bug #13227]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_refinement.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index 66202cda11..a178f24591 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -1829,6 +1829,38 @@ class TestRefinement < Test::Unit::TestCase end; end + module SuperToModule + class Parent + end + + class Child < Parent + end + + module FooBar + refine Parent do + def to_s + "Parent" + end + end + + refine Child do + def to_s + super + " -> Child" + end + end + end + + using FooBar + def Child.test + new.to_s + end + end + + def test_super_to_module + bug = '[ruby-core:79588] [Bug #13227]' + assert_equal("Parent -> Child", SuperToModule::Child.test, bug) + end + private def eval_using(mod, s) |