Skip to content

Add specs for Method#/UnboundMethod#original_name through three-alias chain#1354

Merged
eregon merged 1 commit intoruby:masterfrom
sampokuokkanen:original-name-three-steps
May 4, 2026
Merged

Add specs for Method#/UnboundMethod#original_name through three-alias chain#1354
eregon merged 1 commit intoruby:masterfrom
sampokuokkanen:original-name-three-steps

Conversation

@sampokuokkanen
Copy link
Copy Markdown
Contributor

Extend MethodSpecs::Methods and UnboundMethodSpecs::Methods with a third alias hop (alias qux baz), and add examples verifying that Method#original_name and UnboundMethod#original_name still return :foo when reached through three levels of aliasing.

The current two step one can be passed by an implementation does not walk the full chain.

Noticed that the two step test passes on JRuby master and fails if you add a third step when working on adding #1353.

…as chain

Extend MethodSpecs::Methods and UnboundMethodSpecs::Methods with a third
alias hop (alias qux baz), and add examples verifying that
Method#original_name and UnboundMethod#original_name still return :foo
when reached through three levels of aliasing.

The existing "aliased twice" examples only exercise two-hop chains, which
doesn't catch implementations that resolve a fixed depth rather than walking
the full chain.
@eregon eregon merged commit d3c94d1 into ruby:master May 4, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants