Issue #5751 has been reported by spencer roan.

----------------------------------------
Bug #5751: functions unable to handle hashes containing spaces unless wrapped in parenthesis
http://redmine.ruby-lang.org/issues/5751

Author: spencer roan
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: 1.9.2


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