Skip to content

Commit eaef7e5

Browse files
authored
Merge pull request #7575 from headius/super_method_in_metaclass
Fix Method#super_method.owner pointing at wrong class
2 parents 0e0cb48 + 24f5d20 commit eaef7e5

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

core/src/main/java/org/jruby/AbstractRubyMethod.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ protected IRubyObject super_method(ThreadContext context, IRubyObject receiver,
153153
}
154154

155155
if (receiver == null) {
156-
return RubyUnboundMethod.newUnboundMethod(superClass, methodName, superClass, originName, entry);
156+
return RubyUnboundMethod.newUnboundMethod(entry.sourceModule, methodName, superClass, originName, entry);
157157
} else {
158-
return RubyMethod.newMethod(superClass, methodName, superClass, originName, entry, receiver);
158+
return RubyMethod.newMethod(entry.sourceModule, methodName, superClass, originName, entry, receiver);
159159
}
160160
}
161161

test/mri/excludes/TestMethod.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@
44
exclude :test_callee, "needs investigation"
55
exclude :test_define_method_visibility, "needs investigation"
66
exclude :test_gced_bmethod, "often 'Timeout::Error: execution of assert_normal_exit expired' on CI"
7-
exclude :test_inspect, "fails since an alias-ed method does not distinguish owner and implementor module"
87
exclude :test_hash, "won't pass since Array#map is not a Array#collect alias as in MRI"
98
exclude :test_orphan_callee, "needs investigation"
109
exclude :test_prepended_public_zsuper, "2.4 fix/change to prepend + method + super_method (#4687)"
1110
exclude :test_splat_long_array, "passes locally but fails on travis OOME"
12-
exclude :test_super_method_module, "needs investigation, new in 2.5"
13-
exclude :test_super_method_with_prepended_module, "2.5 test for super with prepend has issues (#4687)"
14-
exclude :test_to_proc_binding, "NullPointerException in parser"
1511
exclude :test_super_method_alias_to_prepended_module, "needs investigation"
16-
exclude :test_super_method_alias, "needs investigation"
12+
exclude :test_to_proc_binding, "NullPointerException in parser"

0 commit comments

Comments
 (0)