Actions
Bug #20229
closedEmpty keyword splat in array not removed in ARGSPUSH case
Bug #20229:
Empty keyword splat in array not removed in ARGSPUSH case
Description
For the following code:
a = []
kw = {}
[*a, **kw]
Ruby 2.0-3.3 return [{}], when the desired result (since 2.7) is [].
I discovered this while working on an optimization for the ARGSCAT case, where [*a, 1, **kw] allocates two arrays instead of a single array. My optimization fixes that by adding a pushtoarraykwsplat instruction as a replacement for newarraykwsplat. I've used pushtoarraykwsplat in the ARGSPUSH case to fix this bug.
My pull request for the bug fix and optimization: https://github.com/ruby/ruby/pull/9766
Actions