[ruby-core:69119] [Ruby trunk - Misc #11131] Unexpected splatting of empty kwargs

From: nobu@...
Date: 2015-05-11 05:13:01 UTC
List: ruby-core #69119
Issue #11131 has been updated by Nobuyoshi Nakada.

Description updated

----------------------------------------
Misc #11131: Unexpected splatting of empty kwargs
https://bugs.ruby-lang.org/issues/11131#change-52373

* Author: zimba tm
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
~~~ruby
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.



-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next