-
Notifications
You must be signed in to change notification settings - Fork 34
Avoid conflict with Ruby's numbered parameters #380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid conflict with Ruby's numbered parameters #380
Conversation
Signed-off-by: Takahiro SATOH <zalt50cc@gmail.com>
|
Closing this for now since there are still some issues left. |
|
This change doesn't seem to be affected on Ruby 3.4.7, so I'm reopening this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses a Ruby 4.0.0 compatibility issue by renaming output history variables to avoid conflicts with Ruby's numbered parameters (_1, _2, etc.). The change ensures IRuby continues to work correctly with Ruby 4.0.0, where Binding#local_variables no longer includes numbered parameters.
- Changed output variable naming from
_<n>to_o<n>to avoid conflict with Ruby's reserved numbered parameters
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| out = super | ||
|
|
||
| # TODO Add IRuby.cache_size which controls the size of the Out array | ||
| # and sets the oldest entries and _<n> variables to nil. |
Copilot
AI
Dec 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment still references the old variable naming pattern _<n>. This should be updated to _o<n> to match the new naming convention introduced in this change.
| # and sets the oldest entries and _<n> variables to nil. | |
| # and sets the oldest entries and _o<n> variables to nil. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
|
Thank you for your contribution. |
Binding#local_variablesdoes no longer include numbered parameters like_1in Ruby4. See https://www.ruby-lang.org/en/news/2025/12/25/ruby-4-0-0-released/ .