Project

General

Profile

Misc #11131

Updated by nobu (Nobuyoshi Nakada) about 7 years ago

~~~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.

Back