Project

General

Profile

Actions

Bug #8139

closed

keyreq and keyrest

Added by no6v (Nobuhiro IMAI) about 11 years ago. Updated almost 11 years ago.

Status:
Closed
Target version:
-
ruby -v:
Backport:
[ruby-core:53608]

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

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

  • vm_insnhelper.c (vm_callee_setup_keyword_arg): should check required
    keyword arguments even if rest hash is defined. [ruby-core:53608]
    [Bug #8139]
Actions #2

Updated by nagachika (Tomoyuki Chikanaga) about 11 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport200
  • Category deleted (core)
  • Status changed from Closed to Assigned
  • Assignee set to nagachika (Tomoyuki Chikanaga)

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

Actions #3

Updated by nagachika (Tomoyuki Chikanaga) almost 11 years ago

  • Tracker changed from Backport to Bug
  • Project changed from Backport200 to Ruby master
  • Status changed from Assigned to Closed
  • Assignee changed from nagachika (Tomoyuki Chikanaga) to nobu (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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0