summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--proc.c2
-rw-r--r--test/ruby/test_method.rb12
-rw-r--r--version.h6
3 files changed, 16 insertions, 4 deletions
diff --git a/proc.c b/proc.c
index 275cc1b468..ba8242e01a 100644
--- a/proc.c
+++ b/proc.c
@@ -2654,7 +2654,7 @@ method_super_method(VALUE method)
const rb_method_entry_t *me;
TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
- super_class = RCLASS_SUPER(method_entry_defined_class(data->me));
+ super_class = RCLASS_SUPER(RCLASS_ORIGIN(method_entry_defined_class(data->me)));
if (!super_class) return Qnil;
me = (rb_method_entry_t *)rb_callable_method_entry_without_refinements(super_class, data->me->called_id);
if (!me) return Qnil;
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index 83ad484238..1f8b86acdc 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -901,6 +901,18 @@ class TestMethod < Test::Unit::TestCase
assert_nil(m)
end
+ def test_super_method_with_prepended_module
+ bug = '[ruby-core:81666] [Bug #13656] should be the method of the parent'
+ c1 = EnvUtil.labeled_class("C1") {def m; end}
+ c2 = EnvUtil.labeled_class("C2", c1) {def m; end}
+ c2.prepend(EnvUtil.labeled_module("M"))
+ m1 = c1.instance_method(:m)
+ m2 = c2.instance_method(:m).super_method
+ assert_equal(m1, m2, bug)
+ assert_equal(c1, m2.owner, bug)
+ assert_equal(m1.source_location, m2.source_location, bug)
+ end
+
def rest_parameter(*rest)
rest
end
diff --git a/version.h b/version.h
index 193e235087..bb1128f2c3 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@
#define RUBY_VERSION "2.4.2"
-#define RUBY_RELEASE_DATE "2017-07-18"
-#define RUBY_PATCHLEVEL 146
+#define RUBY_RELEASE_DATE "2017-07-23"
+#define RUBY_PATCHLEVEL 147
#define RUBY_RELEASE_YEAR 2017
#define RUBY_RELEASE_MONTH 7
-#define RUBY_RELEASE_DAY 18
+#define RUBY_RELEASE_DAY 23
#include "ruby/version.h"