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) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id B6D391F4CC for ; Fri, 13 Dec 2024 20:53:32 +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=xcxVFMAk; 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=W6pyn7wI; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1734123209; bh=BHIRseOkcFw7ozVHq/UgNdHFsnFWV8lD09/SmY+NNn0=; 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=xcxVFMAkw2J4JPSTvSTGh3OtZQxzgkFLzw3FbX0F3uvEbSC2G2RvCxUpWv/imLCOW nkvKdtJTDbpm+OPisubLwod3fErxxxhFxMa2nFFsUUk1Hoegsgyz7VxaniJVtaWini o3K7hTFA/B74umFMPKCGyfTAnOE8nqDAaJaL8MG0= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 9410844DE6 for ; Fri, 13 Dec 2024 20:53:29 +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=W6pyn7wI; dkim-atps=neutral Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 8C3D644C03 for ; Fri, 13 Dec 2024 20:53:16 +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=S92hyygdeWMuO1FgU4B5Y/Bdu90sf3L9bYrsoZEdiOc=; b=W6pyn7wIw5LXBAR6Lrbh9nANqyQoAcHiEL2e+L1Kj8exV4qja30o27M5PK8And6jj6xa oMPKAAzRUb3oa52ueyLxCDhxXJT9oMRa6GW2JJaCZcDZ1HHSJ6GG3aeEM1B5P30X9DdxDl RHxYR3kjP13uP2bOfNWcNVFiVDl4HK2MNcCCYX67orpcmn/mkcvNCy2tCnMq8fUYMzuGoX SOyAIHmEW8EsQ2EXjoGTuB0L9wvBVOHo80C7wUBpletodU11OD/xWP0bOaxO6PBfLjrjwf ZvCg2X5zOqeyuiERB4bdKrZotbOSrlzJgVBAVgx76pIR6iE6NgTd9ILEJDUV0hVw== Received: by recvd-5c8ccdbd88-mkctt with SMTP id recvd-5c8ccdbd88-mkctt-1-675C9EBB-8 2024-12-13 20:53:15.525506065 +0000 UTC m=+2503801.542828900 Received: from herokuapp.com (unknown) by geopod-ismtpd-18 (SG) with ESMTP id xGKybnryRoCfJqhb706YGQ for ; Fri, 13 Dec 2024 20:53:15.462 +0000 (UTC) Date: Fri, 13 Dec 2024 20:53:15 +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: 96912 X-SG-EID: =?us-ascii?Q?u001=2ELyyp8a6L4BPdoBZ5kcNQuEdalXgUnCKLcPykf2c9d2sTWfvALBzqM4Ij+?= =?us-ascii?Q?Jg9Prp2eVDkf9lIZhzc05KfUT4Npfgnigb95d+v?= =?us-ascii?Q?hGuAMoCQYcI15riURPnK0FTgUwD5aGlfJMd3aZi?= =?us-ascii?Q?12T9OYe=2FFqsoa=2FqVLmeDhgMo8eFSZh4TCbioK+I?= =?us-ascii?Q?+DA0lxkeS28FGPU3hKuzbA2eZYyKGBDiSsywpUh?= =?us-ascii?Q?MKkAkOaP8+Ex67+U9YwRN0eJfrvPfihBi17C+Y5?= =?us-ascii?Q?2F3oq6tWFnDVw0pBx4UPPp1vNA=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: Y65S5YUS7PVOXPPB6HKOBF4Q5MGMDLEB X-Message-ID-Hash: Y65S5YUS7PVOXPPB6HKOBF4Q5MGMDLEB 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:120235] [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). Same is true for block arguments: ``` $ ruby34 -c -e "matrix[5, &block] = 8" Syntax OK $ ruby34 --parser=parse.y -c -e "matrix[5, &block] = 8" -e:1: block arg given in index assignment matrix[5, &block] = 8 ruby34: compile error (SyntaxError) ``` ---------------------------------------- Bug #20952: A weird error message for []= with keyword arguments https://bugs.ruby-lang.org/issues/20952#change-111000 * 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/