Actions
Bug #20051
closedOp asgn calls handle keywords and keyword splats as positional arguments
Bug #20051:
Op asgn calls handle keywords and keyword splats as positional arguments
Description
Ruby passes a keywords given to op asgn method calls as a positional hash argument, both to [] and []=:
foo[kw: 1] += bar
This seems wrong, because foo[kw: 1] passes kw: 1 as keywords.
Worse, Ruby passes a keyword splat given to the op asgn method calls as a regular positional argument to [] and []=, with no to_hash conversion:
foo[**kw] += bar
Example:
[1][**0] += 2
# => 3
I'll try to fix this before the 3.3 release if I have time, but if anyone else wants to work on a fix, please do so.
Actions