ruby-changes:47703
From: nagachika <ko1@a...>
Date: Sun, 10 Sep 2017 19:10:33 +0900 (JST)
Subject: [ruby-changes:47703] nagachika:r59819 (ruby_2_4): merge revision(s) 59613: [Backport #13817]
nagachika 2017-09-10 19:10:28 +0900 (Sun, 10 Sep 2017) New Revision: 59819 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59819 Log: merge revision(s) 59613: [Backport #13817] vm_method.c: alias warning at refined method * vm_method.c (rb_method_entry_make): suppress a warning at refined method which will not be redefined. [ruby-core:82385] [Bug #13817] Modified directories: branches/ruby_2_4/ Modified files: branches/ruby_2_4/test/ruby/test_refinement.rb branches/ruby_2_4/version.h branches/ruby_2_4/vm_method.c Index: ruby_2_4/vm_method.c =================================================================== --- ruby_2_4/vm_method.c (revision 59818) +++ ruby_2_4/vm_method.c (revision 59819) @@ -547,6 +547,7 @@ rb_method_entry_make(VALUE klass, ID mid https://github.com/ruby/ruby/blob/trunk/ruby_2_4/vm_method.c#L547 if (RTEST(ruby_verbose) && type != VM_METHOD_TYPE_UNDEF && (old_def->alias_count == 0) && + !make_refined && old_def->type != VM_METHOD_TYPE_UNDEF && old_def->type != VM_METHOD_TYPE_ZSUPER && old_def->type != VM_METHOD_TYPE_ALIAS) { Index: ruby_2_4/version.h =================================================================== --- ruby_2_4/version.h (revision 59818) +++ ruby_2_4/version.h (revision 59819) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #define RUBY_VERSION "2.4.2" #define RUBY_RELEASE_DATE "2017-09-10" -#define RUBY_PATCHLEVEL 192 +#define RUBY_PATCHLEVEL 193 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 9 Index: ruby_2_4/test/ruby/test_refinement.rb =================================================================== --- ruby_2_4/test/ruby/test_refinement.rb (revision 59818) +++ ruby_2_4/test/ruby/test_refinement.rb (revision 59819) @@ -1900,6 +1900,23 @@ class TestRefinement < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/ruby/test_refinement.rb#L1900 end end + def test_refined_method_alias_warning + c = Class.new do + def t; :t end + def f; :f end + end + Module.new do + refine(c) do + alias foo t + end + end + assert_warning('', '[ruby-core:82385] [Bug #13817] refined method is not redefined') do + c.class_eval do + alias foo f + end + end + end + private def eval_using(mod, s) Index: ruby_2_4 =================================================================== --- ruby_2_4 (revision 59818) +++ ruby_2_4 (revision 59819) Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r59613 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/