ruby-changes:55031
From: nagachika <ko1@a...>
Date: Wed, 13 Mar 2019 08:35:35 +0900 (JST)
Subject: [ruby-changes:55031] nagachika:r67238 (ruby_2_5): merge revision(s) 66436: [Backport #15427]
nagachika 2019-03-13 08:35:29 +0900 (Wed, 13 Mar 2019) New Revision: 67238 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67238 Log: merge revision(s) 66436: [Backport #15427] should use defined_class. * vm_insnhelper.c (vm_call_method_each_type): we should use me->defined_class instead of me->owner because me->owner doesn't has correct ancestors list. [Bug #15427] Modified directories: branches/ruby_2_5/ Modified files: branches/ruby_2_5/test/ruby/test_module.rb branches/ruby_2_5/version.h branches/ruby_2_5/vm_insnhelper.c Index: ruby_2_5/vm_insnhelper.c =================================================================== --- ruby_2_5/vm_insnhelper.c (revision 67237) +++ ruby_2_5/vm_insnhelper.c (revision 67238) @@ -2276,7 +2276,7 @@ vm_call_method_each_type(rb_execution_co https://github.com/ruby/ruby/blob/trunk/ruby_2_5/vm_insnhelper.c#L2276 break; case VM_METHOD_TYPE_ZSUPER: - return vm_call_zsuper(ec, cfp, calling, ci, cc, RCLASS_ORIGIN(cc->me->owner)); + return vm_call_zsuper(ec, cfp, calling, ci, cc, RCLASS_ORIGIN(cc->me->defined_class)); case VM_METHOD_TYPE_REFINED: { const rb_cref_t *cref = rb_vm_get_cref(cfp->ep); Index: ruby_2_5/version.h =================================================================== --- ruby_2_5/version.h (revision 67237) +++ ruby_2_5/version.h (revision 67238) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_5/version.h#L1 #define RUBY_VERSION "2.5.4" #define RUBY_RELEASE_DATE "2019-03-13" -#define RUBY_PATCHLEVEL 150 +#define RUBY_PATCHLEVEL 151 #define RUBY_RELEASE_YEAR 2019 #define RUBY_RELEASE_MONTH 3 Index: ruby_2_5/test/ruby/test_module.rb =================================================================== --- ruby_2_5/test/ruby/test_module.rb (revision 67237) +++ ruby_2_5/test/ruby/test_module.rb (revision 67238) @@ -2290,6 +2290,24 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_5/test/ruby/test_module.rb#L2290 end; end + def test_private_extended_module + assert_separately [], %q{ + class Object + def bar; "Object#bar"; end + end + module M1 + def bar; super; end + end + module M2 + include M1 + private(:bar) + def foo; bar; end + end + extend M2 + assert_equal 'Object#bar', foo + } + end + private def assert_top_method_is_private(method) Index: ruby_2_5 =================================================================== --- ruby_2_5 (revision 67237) +++ ruby_2_5 (revision 67238) Property changes on: ruby_2_5 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r66436 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/