Project

General

Profile

Actions

Feature #6096

closed

Parser tweak - curly braces followed by a coma...

Added by ddebernardy (Denis de Bernardy) over 12 years ago. Updated over 12 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:42977]

Description

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 `'

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

assert_equal {}, do_stuff

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0