diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-26 10:32:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-26 10:32:58 +0000 |
commit | e973bde0d003ecec46c8f8946a50cf5120c17b60 (patch) | |
tree | a9efd6a19658f77b95122d46237a7b39be94f3f2 /test/ruby | |
parent | 3802fb92ff8c83eed3e867db20f72c53932f542d (diff) | |
download | ruby-e973bde0d003ecec46c8f8946a50cf5120c17b60.tar.gz |
vm_method.c: fix super in refined module
* vm_method.c (rb_method_entry_complement_defined_class): clone
the original method entry of refined module instance method with
the active ICLASS, to track super method chain.
[ruby-dev:50390] [Bug #14232]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_refinement.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb index 3aab6e4f1e..5583ce6a7a 100644 --- a/test/ruby/test_refinement.rb +++ b/test/ruby/test_refinement.rb @@ -2055,6 +2055,25 @@ class TestRefinement < Test::Unit::TestCase INPUT end + def test_super_from_refined_module + a = EnvUtil.labeled_module("A") do + def foo;"[A#{super}]";end + end + b = EnvUtil.labeled_class("B") do + def foo;"[B]";end + end + c = EnvUtil.labeled_class("C", b) do + include a + def foo;"[C#{super}]";end + end + d = EnvUtil.labeled_module("D") do + refine(a) do + def foo;end + end + end + assert_equal("[C[A[B]]]", c.new.foo, '[ruby-dev:50390] [Bug #14232]') + end + private def eval_using(mod, s) |