Skip to content

UnboundMethod#bind should introduce include class#7555

Merged
headius merged 2 commits intojruby:jruby-9.3from
headius:unbound_super_9.3
Jan 5, 2023
Merged

UnboundMethod#bind should introduce include class#7555
headius merged 2 commits intojruby:jruby-9.3from
headius:unbound_super_9.3

Conversation

@headius
Copy link
Member

@headius headius commented Jan 5, 2023

When the incoming UnboundMethod is from a Module not already
included in the target receiver's class hierarchy, the newly bound
Method should treat that method as living in a virtual module
included below the receiver's class. This allows the rebound
method to use super to call a method of the same name in the
receiver's hierarchy.

For the original change in CRuby (2.2) see:

ruby/ruby@46f578d

For the additional change to avoid the extra include class when
the owner module is already in the target hierarchy, see:

ruby/ruby@160b67d

Fixes #7548.

@headius headius added this to the JRuby 9.3.10.0 milestone Jan 5, 2023
@headius headius force-pushed the unbound_super_9.3 branch from 4ea907e to 042d706 Compare January 5, 2023 20:29
When the incoming UnboundMethod is from a Module not already
included in the target receiver's class hierarchy, the newly bound
Method should treat that method as living in a virtual module
included below the receiver's class. This allows the rebound
method to use `super` to call a method of the same name in the
receiver's hierarchy.

For the original change in CRuby (2.2) see:

ruby/ruby@46f578d

For the additional change to avoid the extra include class when
the owner module is already in the target hierarchy, see:

ruby/ruby@160b67d

Fixes jruby#7548.
@headius headius force-pushed the unbound_super_9.3 branch from 042d706 to cdd9ee1 Compare January 5, 2023 20:50
@headius
Copy link
Member Author

headius commented Jan 5, 2023

The failures are not due to my patch, and must mean GHA has updated to an environment that triggers these issues. I will merge this and look into those separately.

@headius headius merged commit 936ef04 into jruby:jruby-9.3 Jan 5, 2023
@headius headius deleted the unbound_super_9.3 branch January 5, 2023 22:03
headius added a commit to headius/jruby that referenced this pull request Jan 5, 2023
Additional change for bind_call to allow supering out of rebound
methods. See jruby#7555.

Fixes jruby#7548 for 9.4.
edipofederle pushed a commit to edipofederle/jruby that referenced this pull request Feb 8, 2023
Additional change for bind_call to allow supering out of rebound
methods. See jruby#7555.

Fixes jruby#7548 for 9.4.
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.

1 participant