[前][次][番号順一覧][スレッド一覧]

ruby-changes:47762

From: usa <ko1@a...>
Date: Thu, 14 Sep 2017 13:19:36 +0900 (JST)
Subject: [ruby-changes:47762] usa:r59880 (ruby_2_3): merge revision(s) 59613: [Backport #13817]

usa	2017-09-14 13:19:30 +0900 (Thu, 14 Sep 2017)

  New Revision: 59880

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59880

  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_3/
  Modified files:
    branches/ruby_2_3/test/ruby/test_refinement.rb
    branches/ruby_2_3/version.h
    branches/ruby_2_3/vm_method.c
Index: ruby_2_3/test/ruby/test_refinement.rb
===================================================================
--- ruby_2_3/test/ruby/test_refinement.rb	(revision 59879)
+++ ruby_2_3/test/ruby/test_refinement.rb	(revision 59880)
@@ -1656,6 +1656,23 @@ class TestRefinement < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/ruby/test_refinement.rb#L1656
     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_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 59879)
+++ ruby_2_3/version.h	(revision 59880)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.5"
 #define RUBY_RELEASE_DATE "2017-09-14"
-#define RUBY_PATCHLEVEL 370
+#define RUBY_PATCHLEVEL 371
 
 #define RUBY_RELEASE_YEAR 2017
 #define RUBY_RELEASE_MONTH 9
Index: ruby_2_3/vm_method.c
===================================================================
--- ruby_2_3/vm_method.c	(revision 59879)
+++ ruby_2_3/vm_method.c	(revision 59880)
@@ -544,6 +544,7 @@ rb_method_entry_make(VALUE klass, ID mid https://github.com/ruby/ruby/blob/trunk/ruby_2_3/vm_method.c#L544
 	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_3
===================================================================
--- ruby_2_3	(revision 59879)
+++ ruby_2_3	(revision 59880)

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r59613

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]