Project

General

Profile

Actions

Bug #17190

closed

Not working multiple assignment by rightward assignment statement

Added by yancya (Shinta Koyanagi) over 4 years ago. Updated about 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.0preview1 (2020-09-25 master 0096d2b895) [x86_64-darwin19]
[ruby-dev:50962]

Description

For example. It is foo.rb

42, 42 => a, b
p a
p b

I expected it.

42
42

But, Real result.

hoge.rb:1: syntax error, unexpected ',', expecting end-of-input
42, 42 => a, b

Is this intentional?

Updated by shyouhei (Shyouhei Urabe) about 4 years ago

You need parens.

[42, 42] => a, b
Actions #2

Updated by jeremyevans0 (Jeremy Evans) about 4 years ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0