Project

General

Profile

Actions

Bug #9669

closed

Inconsistent SyntaxError in Ruby 2.1 mandatory keyword arguments definition without parentheses.

Added by tejanium (Teja Sophista) over 10 years ago. Updated over 10 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
2.1.1
[ruby-core:61658]

Description

Ruby allowed us to define method with arguments without parentheses.

def foo a:, b:
  'bar'
end
#=> :foo

def foo a:, b:
  puts 'bar'
end
#=> syntax error

Related issues 2 (0 open2 closed)

Related to Ruby master - Bug #10279: Syntax error on Hash with symbol syntax and nested expression: 2.1.3 regression Closednobu (Nobuyoshi Nakada)09/22/2014Actions
Has duplicate Ruby master - Bug #9722: Failure with multiple keyword argumentsClosed04/10/2014Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0