[#65451] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...

Issue #10333 has been updated by Koichi Sasada.

9 messages 2014/10/07

[ruby-core:65714] [ruby-trunk - Bug #10388] [Open] Operator precedence problem in multiple assignment (massign)

From: knu@...
Date: 2014-10-15 03:35:52 UTC
List: ruby-core #65714
Issue #10388 has been reported by Akinori MUSHA.

----------------------------------------
Bug #10388: Operator precedence problem in multiple assignment (massign)
https://bugs.ruby-lang.org/issues/10388

* Author: Akinori MUSHA
* Status: Open
* Priority: Low
* Assignee: Yukihiro Matsumoto
* Category: syntax
* Target version: 
* ruby -v: ruby 2.2.0dev (2014-10-13 trunk 47904) [x86_64-freebsd10]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
I understand it wouldn't be easy to fix this, but since I happened to find it here it goes.

- `a, b = c = 1, 2` is currently taken as `a, b = (c = 1), 2`; I'd expect it to be taken as `a, b = (c = 1, 2)`.

- `a, b = *c = 1, 2` is currently taken as `a, b = *(c = 1), 2`; I'd expect it to be taken as `a, b = *(c = 1, 2)` or even `a, b = (*c = 1, 2)`.

- `a, b = c, d = 1, 2` is currently taken as `a, b = (c), (d = 1), 2`; I'd expect it to be taken as `a, b = (c, d = 1, 2)`.

Should they be fixed/changed or not, issuing a warning would be greatly helpful.



-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next