Project

General

Profile

Actions

Feature #14603

closed

Better error message when double-splatting hash with string keys

Added by apotonick (Nick Sutterer) over 6 years ago. Updated over 6 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:86113]

Description

I couldn't find an existing issue even though I remember reading about it somewhere.

When double-splatting a hash with string keys, the error message is very cryptic.


a( **{ "key" => 1} )
#=> TypeError (wrong argument type String (expected Symbol))

Would it make sense to have a more descriptive error message here, such as "hash key "key" is not a Symbol" or something?

Actions

Also available in: Atom PDF

Like0
Like0Like0