Project

General

Profile

Actions

Bug #8139

closed

keyreq and keyrest

Added by no6v (Nobuhiro IMAI) about 11 years ago. Updated about 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

Also available in: Atom PDF

Like0
Like0Like0Like0