Actions
Bug #11236
closedinconsistent behavior using ** vs hash as method parameter
Bug #11236:
inconsistent behavior using ** vs hash as method parameter
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
Description
Updated by jeremyevans0 (Jeremy Evans) about 11 years ago
This is expected behavior, keyword argument hashes only support symbol keys, not hash keys. I suppose the error message could be better, though.
Updated by nobu (Nobuyoshi Nakada) about 11 years ago
- Description updated (diff)
What message would be better?
Updated by akostadinov (Aleksandar Kostadinov) about 11 years ago
Nobuyoshi Nakada wrote:
What message would be better?
Unsupported key type?
btw what is the reason to have that limitation? Not that I need this functionality, I just happened to notice the difference...
Updated by hsbt (Hiroshi SHIBATA) over 8 years ago
- Related to Feature #14183: "Real" keyword argument added
Updated by marcandre (Marc-Andre Lafortune) almost 8 years ago
When last argument is hash-like but has keys that are not symbols, we could output instead "wrong number of arguments (2 for 1); note that the last argument has keys that are not symbols and thus was not considered as keyword parameters"
Updated by jeremyevans0 (Jeremy Evans) almost 7 years ago
- Status changed from Open to Closed
With the the changes in #14183, keyword splats can support arbitrary keys, and the second example now passes:
Actions