Project

General

Profile

Actions

Bug #16853

closed

calling bla(hash, **kw) with a string-based hash passes the strings into **kw (worked < 2.7)

Added by sylvain.joyeux (Sylvain Joyeux) over 4 years ago. Updated over 4 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:98318]

Description

The following code

def bla(hash = {}, **kw)
    puts "H: #{hash}"
    puts "K: #{kw}"
end

bla "some" => "string"

silently outputs the following (no warnings about deprecation of keyword parameters-from-hash)

H: {}
K: {"some"=>"string"}

While 2.6.5 (and versions before it) gave

H: {"some"=>"string"}
K: {}

I would expect "the warning" that started appearing in 2.7, and definitely not having strings in a keyword argument hash.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0