Issue #6096 has been updated by Nobuyoshi Nakada.

Category set to core


----------------------------------------
Feature #6096: Parser tweak - curly braces followed by a coma...
https://bugs.ruby-lang.org/issues/6096

Author: Denis de Bernardy
Status: Open
Priority: Low
Assignee: 
Category: core
Target version: 


It would be sweet if ruby treated curly braces followed by a coma as a hash rather than as a coma:

>> def foo(bar, baz)
>> end
=> nil
>> foo {}, :baz
SyntaxError: (irb):3: syntax error, unexpected ',', expecting $end
foo {}, :baz
       ^
	from /opt/local/bin/irb:12:in `<main>'

I keep forgetting and run into the issue on a regular basis when writing unit tests... aka:

assert_equal {}, do_stuff


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