Actions
Misc #11131
closedUnexpected splatting of empty kwargs
Status:
Closed
Assignee:
-
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.
Updated by nobu (Nobuyoshi Nakada) over 9 years ago
- Is duplicate of Bug #10856: Splat with empty keyword args gives unexpected results added
Updated by nobu (Nobuyoshi Nakada) over 9 years ago
- Description updated (diff)
Updated by nobu (Nobuyoshi Nakada) about 7 years ago
- Status changed from Open to Closed
Applied in changeset trunk|r59519.
splat keyword hash
-
compile.c (compile_array_keyword_arg): set keyword splat flag if
explicitly splatted. [ruby-core:68124] [Bug #10856] -
vm_args.c (setup_parameters_complex): try keyword hash splat if
given.
Actions
Like0
Like0Like0Like0