Bug #8139

keyreq and keyrest

Added by Nobuhiro IMAI about 1 year ago. Updated about 1 year ago.

[ruby-core:53608]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
Category:-
Target version:-
ruby -v: Backport:

Description

=begin
Passing a hash without required key (:keyreq) to a method which takes keyreq: and **keyrest,
then a same hash is set to both keyreq and keyrest.

def m(keyreq:, **keyrest)
[keyreq, keyrest]
end

m(keyreq: 1, keyrest: 2) # => [1, {:keyrest => 2}] OK
m(unknown: 3) # => [{:unknown=>3}, {:unknown=>3}] ??
=end

Associated revisions

Revision 39869
Added by Nobuyoshi Nakada about 1 year ago

vm_insnhelper.c: check required kwarg with resthash

  • vminsnhelper.c (vmcalleesetupkeyword_arg): should check required keyword arguments even if rest hash is defined. [Bug #8139]

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 r39869.
Nobuhiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


vm_insnhelper.c: check required kwarg with resthash

  • vminsnhelper.c (vmcalleesetupkeyword_arg): should check required keyword arguments even if rest hash is defined. [Bug #8139]

#2 Updated by Tomoyuki Chikanaga about 1 year ago

  • Tracker changed from Bug to Backport
  • Project changed from ruby-trunk to Backport200
  • Category deleted (core)
  • Status changed from Closed to Assigned
  • Assignee set to Tomoyuki Chikanaga

I think this is definitely a bugfix. I'll backport r39869.

#3 Updated by Tomoyuki Chikanaga about 1 year ago

  • Tracker changed from Backport to Bug
  • Project changed from Backport200 to ruby-trunk
  • Status changed from Assigned to Closed
  • Assignee changed from Tomoyuki Chikanaga to Nobuyoshi Nakada

It is a bugfix about require keyword arguments which is a new feature of 2.1. [Feature #7701]
No need to backport. sorry.

Also available in: Atom PDF