Project

General

Profile

Actions

Misc #11131

closed

Unexpected splatting of empty kwargs

Added by zimbatm (zimba tm) about 7 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
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