Project

General

Profile

Actions

Bug #19918

closed

Should `a[&b]=c` be syntax valid?

Added by tompng (tomoya ishida) about 1 year ago. Updated 8 months ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 3.3.0dev (2023-10-11T04:46:58Z master 40ab7b8c24) [x86_64-linux]
[ruby-core:114997]

Description

These codes are syntax valid now. Prism parses it as syntax error.

a[&b]=c
a[&b]+=c
a[&b]&&=c
a[&b]||=c

Is this syntax intentional or should be error?

Issue of Prism
https://github.com/ruby/prism/issues/1636

It's added in test_parse.rb
https://github.com/ruby/ruby/blob/40ab7b8c244de20007cb45846f41de3a01f7ea0c/test/ruby/test_parse.rb#L502

Actions

Also available in: Atom PDF

Like0
Like0Like1Like0Like2Like0Like0Like0