Skip to content

Fix for issue 7256 (jruby-9.3)#7302

Merged
enebo merged 1 commit intojruby:jruby-9.3from
evaniainbrooks:issue-7256-undefined-constants-prepend
Aug 15, 2022
Merged

Fix for issue 7256 (jruby-9.3)#7302
enebo merged 1 commit intojruby:jruby-9.3from
evaniainbrooks:issue-7256-undefined-constants-prepend

Conversation

@evaniainbrooks
Copy link
Contributor

Fixes #7256

Re-creating this original PR (#7299) with base set to jruby-9.3

@enebo
Copy link
Member

enebo commented Aug 11, 2022

@evaniainbrooks Thanks. There is a mechanism for switching branches for the PR opener but it is like an easter egg.

Added comment from older PR here (I should add my approval is obviously contingent on a green CI run):

I added @headius for reviewing this. I approve this but it is mildly scary stuff in possible impact so we should double up on the review. I think the PR is intuitive that the wrappers we make for include/prepend don't contain their own constants. So we should be asking something for it and I believe origin is correct. The actual vocabulary for this has always been confusing. Last year I did a bunch of work on fixing some issues in prepend and I already forgot.

@enebo enebo added this to the JRuby 9.3.7.0 milestone Aug 11, 2022
@enebo enebo merged commit 2ed60a4 into jruby:jruby-9.3 Aug 15, 2022
Copy link
Member

@headius headius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went over this with @enebo so we could understand what wasn't working and I think we are comfortable with it now. Basically the issue is that prepend changes the methodLocation to point at a layer above where we want to look, and delegating back to origin fixes that. It also makes sense to delegate constant lookups to the actual module and never attempt to do it from the include/prepend wrapper. All cases we have come up with work correctly.

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.

3 participants