Project

General

Profile

Actions

Backport #7922

closed

Keyword arguments bug with unnamed rest

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


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 #1

Updated by nobu (Nobuyoshi Nakada) about 11 years 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 (iseq_set_arguments): no keyword check if any keyword rest
    argument exists, even unnamed. [ruby-core:52744] [Bug #7922]
Actions #2

Updated by nobu (Nobuyoshi Nakada) about 11 years ago

  • Category deleted (core)
  • Status changed from Closed to Assigned
  • Assignee changed from nobu (Nobuyoshi Nakada) to mame (Yusuke Endoh)
  • Target version deleted (2.6)
  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport200

Updated by nagachika (Tomoyuki Chikanaga) about 11 years ago

  • Assignee changed from mame (Yusuke Endoh) to nagachika (Tomoyuki Chikanaga)
Actions #4

Updated by nagachika (Tomoyuki Chikanaga) about 11 years 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.  [ruby-core:52744] [Bug #7922]
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0