-
Notifications
You must be signed in to change notification settings - Fork 188
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
[Ruby 3.0 support] Assigning to numbered parameter #2506
[Ruby 3.0 support] Assigning to numbered parameter #2506
Conversation
: node.getPosition(); | ||
warnNumberedParameterLikeDeclaration(position, name); | ||
// assigning to a numbered parameter is a SyntaxError | ||
throw compile_error(name + " is reserved for numbered parameter"); |
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.
TBH I am not sure whether it's a safe change. I just have found a place where the proper warning is printed in the proper situation (and it fixes the added specs).
Also, the else
branch with throw compile_error("Can't assign to numbered parameter " + name);
looks pretty suspicious and looks like covers quite a similar case.
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.
It looks fine, and the change is indeed AFAIK the warning is replaced by an error.
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.
Thank you for the specs and change!
: node.getPosition(); | ||
warnNumberedParameterLikeDeclaration(position, name); | ||
// assigning to a numbered parameter is a SyntaxError | ||
throw compile_error(name + " is reserved for numbered parameter"); |
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.
It looks fine, and the change is indeed AFAIK the warning is replaced by an error.
c6f6cef
to
cad8cba
Compare
This PR addresses
Related issue - #2453
Changes: