Skip to content

Improve alias redefinition warnings#9447

Open
headius wants to merge 4 commits into
jruby:masterfrom
headius:alias_redefinition_fixes
Open

Improve alias redefinition warnings#9447
headius wants to merge 4 commits into
jruby:masterfrom
headius:alias_redefinition_fixes

Conversation

@headius
Copy link
Copy Markdown
Member

@headius headius commented May 20, 2026

These warnings are firing a lot in Rails when they should not. The key piece is setting the aliased method's aliased bit so aliasing back doesn't warn, based on the hack in rails/rails#29233. This PR makes tweaks to handle that case and clean up related code.

headius added 2 commits May 20, 2026 00:48
Make these a single warning call to be a single write as in CRuby.
@headius headius added this to the JRuby 10.1.1.0 milestone May 20, 2026
headius added a commit to headius/jruby that referenced this pull request May 20, 2026
The exact old method should be marked as aliased, so if re-aliased
back again it won't trigger a warning.

See jruby#9447
This is CRuby behavior and Rails uses it as a hack for reverse-
aliasing methods without warnings.

See rails/rails#29233
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