From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 624C71F4CC for ; Fri, 13 Dec 2024 20:02:05 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=St7rGrlF; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=goDLFIlh; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1734120092; bh=KYHL0xtDkUOpW1K7SR66v51Fjz/zMIKgqhYt9ye9/0Q=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=St7rGrlFCmLAbBohQA3SyGTec5NPhZyDsSDmou6IGWvRNOxDg6UpWTkYhmR6WbP+8 7cAHgCz94N1YmjbCF/UUEyfYTE5t9z4MVxxiBZsz14OAGCe7jW2bhn3bRC3GKDAQvT olMILwt7OCQiy76hHc3FdYwvaaLT9QgYf6Rkyd6A= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id F169B44DE7 for ; Fri, 13 Dec 2024 20:01:32 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=goDLFIlh; dkim-atps=neutral Received: from s.wrqvwxzv.outbound-mail.sendgrid.net (s.wrqvwxzv.outbound-mail.sendgrid.net [149.72.154.232]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 159E944B9C for ; Fri, 13 Dec 2024 20:01:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=cO8/+0D6vJrxjHk2desDluVgstQQAn62s3HqVO25DIk=; b=goDLFIlhReyTNIzLRf1vR+ZRoepsXuxrse4PFXdsh4ttbQMGApY9dkZBS7v0LLs9Pab+ jHcb9/IblJbiAJ65zkQ5xauIyRUySDWOPZigGSDO5huDhkKljUbPx9Z4QPlzmgsnD3D7+q MvIJMNDQ6LwdYADHfTFYL17M9qBtDzMPkJd7LcF6Tycdg+Dajinwx2wjd4EzumWZIXWBSP pPkJV3ahqUJTV6tDAg6Yzw5jjG04kMEj5gCD4KeGpHpxvN5yBHWv7cOnYRnYAkjZ8EQ7X3 UYBK6FEEJs2CC19ejED9zhMJzIo+bpRkC7D4mOrwG6/dcKJqy00F1phcxzGd9Ljw== Received: by recvd-69cbc48b94-2tgq2 with SMTP id recvd-69cbc48b94-2tgq2-1-675C928D-5 2024-12-13 20:01:17.059923495 +0000 UTC m=+2500800.389656455 Received: from herokuapp.com (unknown) by geopod-ismtpd-14 (SG) with ESMTP id TSiCs02NT-yMWzVzIdnOMw for ; Fri, 13 Dec 2024 20:01:17.036 +0000 (UTC) Date: Fri, 13 Dec 2024 20:01:17 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20952 X-Redmine-Issue-Author: zverok X-Redmine-Issue-Priority: Normal X-Redmine-Sender: jeremyevans0 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-Redmine-MailingListIntegration-Message-Ids: 96911 X-SG-EID: =?us-ascii?Q?u001=2ELyyp8a6L4BPdoBZ5kcNQuEdalXgUnCKLcPykf2c9d2sTWfvALBzqM4Ij+?= =?us-ascii?Q?Jg9Prp2eVDkf9lIZhzc05KfUT4Npfgnigb95d+v?= =?us-ascii?Q?hGuAMoCQYcJ2aEq1vu6TJdAqdP1t0px6Xu=2FFpC8?= =?us-ascii?Q?Op6icK6ggS0D7vEbO+B639Mdmz62DK+Aj7l11CK?= =?us-ascii?Q?t4Y6u5PSI=2Ft9pfUwA=2FeJ=2FmOv2qtTzJGN4eoHynG?= =?us-ascii?Q?M9StCaZPXCt8Rl4ozeyBfCgK3eJ1QMBCCfa11tF?= =?us-ascii?Q?RP0pAXBl2nDo1Jv05kj2gtsy8Q=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: APIPZ7VUTRJNNYKZPDUNYFFKYPT6OIFN X-Message-ID-Hash: APIPZ7VUTRJNNYKZPDUNYFFKYPT6OIFN X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:120234] [Ruby master Bug#20952] A weird error message for []= with keyword arguments List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "jeremyevans0 (Jeremy Evans) via ruby-core" Cc: "jeremyevans0 (Jeremy Evans)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20952 has been updated by jeremyevans0 (Jeremy Evans). This is a bug in prism. The expected behavior is parse.y's behavior of raising a syntax error: ``` $ ruby34 -c -e "matrix[5, axis: :y] = 8" Syntax OK $ ruby34 --parser=parse.y -c -e "matrix[5, axis: :y] = 8" -e:1: keyword arg given in index assignment matrix[5, axis: :y] = 8 ruby34: compile error (SyntaxError) ``` ---------------------------------------- Bug #20952: A weird error message for []= with keyword arguments https://bugs.ruby-lang.org/issues/20952#change-110999 * Author: zverok (Victor Shepelev) * Status: Open * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED ---------------------------------------- Trying to document the new deprecation of `#[]=` with keyword arguments, I wrote this sample code: ```ruby class MyMatrix # ...some implementation def []=(*args, **kwargs) p(args:, kwargs:) # ...some implementation end end matrix = MyMatrix.new matrix[5, axis: :y] = 8 ``` This fails as expected, but the error message is totally unexpected for me: ``` ruby3_4.rb:11:in '
': undefined method '[]=' for an instance of Integer (NoMethodError) matrix[5, axis: :y] = 8 ^^^^^^^^^^^^^^^ ``` Am I missing some interpretation peculiarity here?.. ``` $ ruby -v ruby 3.4.0dev (2024-12-11T19:50:20Z master 34e68548d4) +PRISM [x86_64-linux] ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/