Project

General

Profile

Actions

Backport #7922

closed

Keyword arguments bug with unnamed rest

Added by marcandre (Marc-Andre Lafortune) about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:52744]

Description

We have:

def foo(**ignore_all_options)
end

foo(bar: 42) # => nil, OK
method(:foo).parameters # => [[:keyrest, :ignore_all_options]], OK

But:

def foo(**)
end

foo(bar: 42) # => ArgumentError: unknown keyword: bar, expected nil
method(:foo).parameters # => [], expected [[:keyrest]]
Actions

Also available in: Atom PDF