Actions
Bug #18396
openAn unexpected "hash value omission" syntax error when without parentheses call expr follows
Bug #18396:
An unexpected "hash value omission" syntax error when without parentheses call expr follows
Status:
Open
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.0dev (2021-12-07T23:18:11Z master 4a3e7984bf) [x86_64-darwin19]
Description
Summary¶
I encountered an unexpected "hash value omission" syntax error when parentheses call expression follows:
% ruby -cv /tmp/b.rb
ruby 3.1.0dev (2021-12-07T23:18:11Z master 4a3e7984bf) [x86_64-darwin19]
example.rb:2: syntax error, unexpected local variable or method, expecting `do' or '{' or '('
foo arg
Additional Information¶
The following is a traditional usage.
A syntax error is unexpectedly raised when hash value omission argument without parentheses is followed by a method call without parentheses.
No error occurs if any of the calls have parentheses.
No error occurs when calling alone.
I encountered this error while trying to apply hash value omission to RSpec code of a real-world application (proprietary) .
But this is a new Ruby 3.1 syntax and may not be supported yet. Thank you.
Actions