From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 4CE361F466 for ; Thu, 16 Jan 2020 06:19:04 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id B68F3120BCD; Thu, 16 Jan 2020 15:18:49 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 17B15120BCB for ; Thu, 16 Jan 2020 15:18:47 +0900 (JST) Received: by filterdrecv-p3iad2-57f487d66-lptsx with SMTP id filterdrecv-p3iad2-57f487d66-lptsx-18-5E20004D-3E 2020-01-16 06:18:53.900673724 +0000 UTC m=+2611935.036958632 Received: from herokuapp.com (unknown [54.158.130.18]) by ismtpd0051p1iad1.sendgrid.net (SG) with ESMTP id _7PL8Jo3SomQGIySbSGXng for ; Thu, 16 Jan 2020 06:18:53.766 +0000 (UTC) Date: Thu, 16 Jan 2020 06:18:53 +0000 (UTC) From: matz@ruby.or.jp Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72552 X-Redmine-Project: ruby-master X-Redmine-Issue-Id: 10388 X-Redmine-Issue-Author: knu X-Redmine-Issue-Assignee: matz X-Redmine-Sender: matz X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?bXEIHGfdFwsIlBTndiToCp=2Fmc2rfxRD2sZAksRKJIHW8TsW6Vz3qBREJilve++?= =?us-ascii?Q?mAbKwo48xlK1MIRtdPt5QZRJFfu+pzqOmCvbQlf?= =?us-ascii?Q?LksYuLwzMjTnJMJ9VgTJ7gXhMq7Hlp6pBWwbeZA?= =?us-ascii?Q?3aNRzDRRaKClBVub5L5g2MjKfEq=2FNmyoCuK+RVX?= =?us-ascii?Q?uV6rHG466qkxExPLiCw1q6wneiJcMalq=2Fdg=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96890 Subject: [ruby-core:96890] [Ruby master Bug#10388] Operator precedence problem in multiple assignment (massign) X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #10388 has been updated by matz (Yukihiro Matsumoto). We are not going to change the behavior. We may warn (with `-W`) if we see the simple assignments on the right-hand side of multiple assignments. Matz. ---------------------------------------- Bug #10388: Operator precedence problem in multiple assignment (massign) https://bugs.ruby-lang.org/issues/10388#change-83902 * Author: knu (Akinori MUSHA) * Status: Open * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * 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/