Actions
Feature #14603
closedBetter error message when double-splatting hash with string keys
Status:
Closed
Assignee:
-
Target version:
-
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?
Updated by shevegen (Robert A. Heiler) over 6 years ago
Ideally we could have some means to control the warning/error format. That
way people could select which variant to prefer, the default one or any
other way, like the one shown above.
Updated by nobu (Nobuyoshi Nakada) over 6 years ago
- Status changed from Open to Closed
Applied in changeset trunk|r62752.
vm.c: refined error message
- vm.c (kw_check_symbol): refined the error message for non-symbol
key. [Feature #14603]
Actions
Like0
Like0Like0