Issue #5751 has been updated by Nobuyoshi Nakada.

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.
----------------------------------------
Bug #5751: functions unable to handle hashes containing spaces unless wrapped in parenthesis
http://redmine.ruby-lang.org/issues/5751

Author: spencer roan
Status: Rejected
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: all


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.


-- 
http://redmine.ruby-lang.org