Project

General

Profile

Actions

Bug #10309

closed

Unexpected keyword parameters becomes an additional mandatory parameter

Added by ko1 (Koichi Sasada) about 10 years ago. Updated about 10 years ago.

Status:
Rejected
Target version:
ruby -v:
2.2 to 2.0
[ruby-core:65334]

Description

Is it an intentional behaviour?

def foo a, b, c, k1: 1
  p [a, b, c, k1]
end

foo 1, 2, {k1: 3, k2: 4}
#=> [1, 2, {:k1=>3, :k2=>4}, 1]

foo 1, 2, k1: 3, k2: 4
#=> [1, 2, {:k1=>3, :k2=>4}, 1]

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #10142: named params don't always capture passed named argsRejected08/15/2014Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0