summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 82bdb49659..c3b4913d06 100644
--- a/test/ruby/test_refinement.rb
+++ b/test/ruby/test_refinement.rb
@@ -1900,6 +1900,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 a64673a632..11d359d55a 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#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
diff --git a/vm_method.c b/vm_method.c
index 57b805406c..c463162d3b 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -547,6 +547,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) {