Backport #7922

Keyword arguments bug with unnamed rest

Added by Marc-Andre Lafortune about 1 year ago. Updated about 1 year ago.

[ruby-core:52744]
Status:Closed
Priority:High
Assignee:Tomoyuki Chikanaga

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]]

Associated revisions

Revision 39670
Added by Tomoyuki Chikanaga about 1 year ago

merge revision(s) 39444,39446: [Backport #7922]

* compile.c (iseq_set_arguments): no keyword check if any keyword rest
  argument exists, even unnamed.   [Bug #7922]

History

#1 Updated by Nobuyoshi Nakada about 1 year ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r39444.
Marc-Andre, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


compile.c: no keyword check if kw_rest

  • compile.c (iseqsetarguments): no keyword check if any keyword rest argument exists, even unnamed. [Bug #7922]

#2 Updated by Nobuyoshi Nakada about 1 year ago

  • Category deleted (core)
  • Status changed from Closed to Assigned
  • Assignee changed from Nobuyoshi Nakada to Yusuke Endoh
  • Target version deleted (next minor)
  • Tracker changed from Bug to Backport
  • Project changed from ruby-trunk to Backport200

#3 Updated by Tomoyuki Chikanaga about 1 year ago

  • Assignee changed from Yusuke Endoh to Tomoyuki Chikanaga

#4 Updated by Tomoyuki Chikanaga about 1 year ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r39670.
Marc-Andre, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 39444,39446: [Backport #7922]

* compile.c (iseq_set_arguments): no keyword check if any keyword rest
  argument exists, even unnamed.   [Bug #7922]

Also available in: Atom PDF