Project

General

Profile

Actions

Misc #11131

closed

Unexpected splatting of empty kwargs

Added by zimbatm (zimba tm) over 9 years ago. Updated over 7 years ago.

Status:
Closed
Assignee:
-
[ruby-core:69116]

Description

def foo(); :ok end
foo(*[]) #=> :ok
foo(**{}) #=> ArgumentError: wrong number of arguments (1 for 0)
foo(*[], **{}) #=> ArgumentError: wrong number of arguments (1 for 0)

I was expecting kwargs splatting to work the same as args splatting and be ignored when an empty container is passed.


Related issues 1 (0 open1 closed)

Is duplicate of Ruby master - Bug #10856: Splat with empty keyword args gives unexpected resultsClosednobu (Nobuyoshi Nakada)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0