-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Labels
Milestone
Description
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
# 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.
Environment
- JRuby on 0034504
Expected Behavior
All lines return { foo: 1 }
Actual Behavior
The first gives a SyntaxError
Reactions are currently unavailable