Fix Method/UnboundMethod#original_name deep alias chains#9420
Merged
Conversation
sampokuokkanen
commented
May 7, 2026
headius
requested changes
May 7, 2026
headius
left a comment
Member
There was a problem hiding this comment.
Let's put is_a? back the way it was. The rest is good. 👍
sampokuokkanen
force-pushed
the
recursive-alias-method
branch
from
May 8, 2026 01:52
7bc879a to
d4b2b47
Compare
Use getRealMethod() instead of entry.method, which only unwrapped one level. Fixes Method#/UnboundMethod#original_name for chains 3+ deep. Also drops the stale RubyMethod#original_name override left over from when the implementation moved to AbstractRubyMethod in 2017.
sampokuokkanen
force-pushed
the
recursive-alias-method
branch
from
May 8, 2026 03:10
d4b2b47 to
05b9ce2
Compare
Contributor
Author
|
Thank you for the review. Removed the change from |
headius
approved these changes
May 8, 2026
This was referenced May 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use getRealMethod() instead of entry.method, which only unwrapped one level. Fixes Method#/UnboundMethod#original_name for chains 3+ deep. Also drops the stale RubyMethod#original_name override left over from when the implementation moved to AbstractRubyMethod.
Fixes the first part of #9257. (except for the usage of
is_a?)I added tests here: ruby/spec#1353 and here: ruby/spec#1354.
With this the sample from the example in the issue becomes the same as MRI. I'm not sure about the breaking up of
kind_of?andis_a?to different Java methods, but this seems to be the way things are done for methods likemap/collect.Sample code: