-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Discrepancy with MRI: assigning to a sequence of variables #1347
Comments
I think this is the first ever bug report I've seen that depends on the return value of a multiple assignment. Kudos :-) The multiple assignment difference is indeed a bug. I confirmed that The SyntaxError is a bit more confusing and is unrelated to the handling of the nil RHS. MRI 1.8.7, 1.9.3, 2.0.0, and 2.1.0 all produce the SyntaxError in IRB but not when running the code directly (they warn instead of erroring). JRuby in 1.8 mode produces the SyntaxError in IRB and when running the code directly. JRuby in 1.9 mode does not produce the error or the warning in either IRB or when running the code directly. JRuby master (2.1 mode only) behaves the same as JRuby in 1.9 mode. I'm going to move your SyntaxError issue to a separate bug. It seems pretty trivial and may not be worth fixing, since JRuby actually seems more correct than MRI when JRuby runs in 1.9 and 2.1 modes. |
Worth noting that the new runtime for JRuby 9000 does handle this masgn correctly:
|
This works in 9k and we will never fix this in 1.7.x as it is winding down (only one last point release until EOL)....resolving as WONTFIX. |
Simplest test case:
Output of JRuby 1.7.9:
=> [nil]
Output of MRI 1.8.7 and 2.0.0p247:
=> nil
Some consequences:
(Thanks to @luisantonioa for helping find the simplest test case for issue.)
EDIT: Moved a parser issue originally reported in this bug to #1353.
The text was updated successfully, but these errors were encountered: