Actions
Bug #5751
closedfunctions unable to handle hashes containing spaces unless wrapped in parenthesis
Description
puts { :a => :b}
SyntaxError: (irb):23: syntax error, unexpected tASSOC, expecting '}'
puts { :a => :b}
puts { a: :b}
SyntaxError: (irb):24: syntax error, unexpected ':', expecting '}'
puts { a: :b}
def foo x
puts x
end
=> nil
foo {:a => :b}
SyntaxError: (irb):28: syntax error, unexpected tASSOC, expecting '}'
foo {:a => :b}
I suspect this is a precedence/binding issue.
Updated by nobu (Nobuyoshi Nakada) almost 13 years ago
- Status changed from Open to Rejected
- ruby -v changed from 1.9.2 to all
A brace after method invocation is parsed as a block.
Actions
Like0
Like0