Project

General

Profile

Bug #17190

Not working multiple assignment by rightward assignment statement

Added by yancya (Shinta Koyanagi) about 1 month ago. Updated 19 days ago.

Status:
Closed
Priority:
Normal
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) 29 days ago

You need parens.

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

Updated by jeremyevans0 (Jeremy Evans) 19 days ago

  • Status changed from Open to Closed

Also available in: Atom PDF