Project

General

Profile

Actions

Bug #22706

open

parse.y: `o[5, *[**{}]] = 8` spuriously rejected as `keyword arg given in index assignment`

Bug #22706: parse.y: `o[5, *[**{}]] = 8` spuriously rejected as `keyword arg given in index assignment`

Added by steviejj (Steven Johnstone) about 15 hours ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:127804]

Description

Differential fuzzing against prism.

o = Object.new
def o.[]=(*args); p args; end

o[5, *[**{}]]      = 8  # => [5, 8]
o[5, *[**{a: 1}]]  = 8  # => [5, {a: 1}, 8]

parse.y:

test.rb:4: keyword arg given in index assignment (SyntaxError)
o[5, *[**{}]]      = 8  # => [5, 8]
       ^~~~
test.rb:5: keyword arg given in index assignment
o[5, *[**{a: 1}]]  = 8  # => [5, {a: 1}, 8]
       ^~~~~~~~

prism:

[5, 8]
[5, {a: 1}, 8]

No data to display

Actions

Also available in: PDF Atom