Issue #15138 has been reported by akr (Akira Tanaka).

----------------------------------------
Bug #15138: non-symbol keyword in double splat, such as **{2 => 3}, raises TypeError or not 
https://bugs.ruby-lang.org/issues/15138

* Author: akr (Akira Tanaka)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
I found that non-symbol keyword in double splat, such as `**{2 => 3}`,
raises TypeError in a situation and doesn't raise in another situation:

```
% ./ruby -ve '
def m(*a) p a end
m(k: 1, **{2 => 3}) # [{:k=>1, 2=>3}]
m(**{4 => 5}) # hash key 4 is not a Symbol (TypeError)
'
ruby 2.6.0dev (2018-09-18 trunk 64776) [x86_64-linux]
[{:k=>1, 2=>3}]
Traceback (most recent call last):
-e:4:in `<main>': hash key 4 is not a Symbol (TypeError)
```

It seems another keyword argument, `k: 0` here, prevent TypeError.
I think this behavior is not intentional.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>