We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
headius
Learn more about funding links in repositories.
Report abuse
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
Hello,
while testing my Ruby 2.3 application with JRuby master I noticed it throwing a syntax error when using &. on an operator.
&.
# Test case giving unexpected behaviour: { foo: 1 }.reject{|_, value| false || value&.<(0)} #=> SyntaxError: unexpected tLPAREN # Removing the `false ||` { foo: 1 }.reject{|_, value| value&.<(0)} #=> { foo: 1 } # This one works! # Adding parantheses { foo: 1 }.reject{|_, value| false || (value&.<(0))} #=> { foo: 1 } # This one works too!
On MRI 2.3.0p0 all reject lines give the same, expected result. On JRuby, the first line fails with a SyntaxError.
All lines return { foo: 1 }
{ foo: 1 }
The first gives a SyntaxError
SyntaxError
The text was updated successfully, but these errors were encountered:
reduced to eliminate block:
false||value&.<(0)
Sorry, something went wrong.
f2ab40c
No branches or pull requests
Hello,
while testing my Ruby 2.3 application with JRuby master I noticed it throwing a syntax error when using
&.
on an operator.Example code
On MRI 2.3.0p0 all reject lines give the same, expected result. On JRuby, the first line fails with a SyntaxError.
Environment
Expected Behavior
All lines return
{ foo: 1 }
Actual Behavior
The first gives a
SyntaxError
The text was updated successfully, but these errors were encountered: