Actions
Bug #20229
closedEmpty 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
Updated by jeremyevans0 (Jeremy Evans) 9 months ago
- Related to Bug #20180: Inconsistent evaluation of `**{}` depending on position in array added
Updated by jeremyevans0 (Jeremy Evans) 9 months ago
Updated by jeremyevans0 (Jeremy Evans) 9 months ago
- Status changed from Open to Closed
Committed as 77c1233f79a0f96a081b70da533fbbde4f3037fa
Actions
Like0
Like0Like0Like0