summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-14 04:19:30 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-14 04:19:30 +0000
commitddda4baf71edeeb288430c6ff71e44c015eb569d (patch)
treec0cac3b4254f0e87afb86fd006ed1efab6bce8bf
parent95c9c1dc1596ef435a5f395fbd1016d9d221830a (diff)
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@59880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_refinement.rb17
-rw-r--r--version.h2
-rw-r--r--vm_method.c1
3 files changed, 19 insertions, 1 deletions
diff --git a/test/ruby/test_refinement.rb b/test/ruby/test_refinement.rb
index 84b9a9964c..ac7c224c9b 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -1656,6 +1656,23 @@ class TestRefinement < Test::Unit::TestCase
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)
diff --git a/version.h b/version.h
index b0961d9b95..93c12b4387 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#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
diff --git a/vm_method.c b/vm_method.c
index 68bebb600a..bb08ce64af 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -544,6 +544,7 @@ rb_method_entry_make(VALUE klass, ID mid, VALUE defined_class, rb_method_visibil
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) {