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 [IPv6:2a01:4f8:1c0c:6b10::1]) (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 048071F44D for ; Sun, 21 Apr 2024 08:47:18 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=KSiVruU2; 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=b62I2vr3; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 5EF5584415; Sun, 21 Apr 2024 08:47:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1713689230; bh=Q0RdeCtMyIsCCVmASC+ZrlOc5WTSgvjOwksRokdt2p8=; 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=KSiVruU2iZ4ckVXeSXbC9ODBLyMoQgVPjwu8XCvLr3d0nVE48uf8fbpJcecgll5BC cDbBkx9/JkOt8/r/+Hme2+o8fEacpEYdjrEnZmWKGpSzefzrMLdrHAOh+AMsNZHOQA i9bVjlwpt+EhFWqAaMUSo7k0yCyG5lbehROd/Yo0= 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 5282384407 for ; Sun, 21 Apr 2024 08:47:07 +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=b62I2vr3; dkim-atps=neutral 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=F2Jyci2iopabUpM2IhPiIbuWdeFGfDiXdM0Xm/gLdwY=; b=b62I2vr3iY6zFhU9chaUcwDHIYTPGJPRCqee3/kDAjetflwDt2IbQvUtCcX/6EBAPn23 Ylg85IT28wCLilih2g7Vv+dMD77lUz/7NXl3BG0b0Nqh+nwTSVKcdsC3PWBv3LQwcaMS8k zDRZKZ7hp8Th8T/4DlVbCJSJAEU8Nnv7bC3DlKn4isjjyfBekjOr1vrt4pSWNMCSeGsNv8 6msxWe7ksYtYGjVxJab3q5TtlkrcDUG5tqieQE6vfzDxKpfSJR9tzrx8nkoU/MhMGhxFwB queskdviJLJu/MmgmCuFa9L9PAKvpqFHlkA5ZznmF5njQULDqOpeVWwFBJ/2jUpg== Received: by filterdrecv-854b845bd5-zjwlb with SMTP id filterdrecv-854b845bd5-zjwlb-1-6624D28A-12 2024-04-21 08:47:06.877753649 +0000 UTC m=+730664.549414319 Received: from herokuapp.com (unknown) by geopod-ismtpd-18 (SG) with ESMTP id SnA1yK5lTsm-2YXcEysgfA for ; Sun, 21 Apr 2024 08:47:06.072 +0000 (UTC) Date: Sun, 21 Apr 2024 08:47:06 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Misc X-Redmine-Issue-Id: 20441 X-Redmine-Issue-Author: ozydingo X-Redmine-Issue-Priority: Normal X-Redmine-Sender: ozydingo 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: 94229 X-SG-EID: =?us-ascii?Q?u001=2EWtjZePZ3IDDBwtRucCmuQUiYSyr+JPf+ZmCYBVn7D93R7gFrWGyOlEszX?= =?us-ascii?Q?asxAGqvNvImWJtoLSflkInthJWIzhiIJGtsXbiv?= =?us-ascii?Q?25bKX5XDbEbzoxF2FkLTlpPLJjSQUNwPJr8XrE3?= =?us-ascii?Q?bKr=2F12DHMbM=2F6L0PTfGPMDL7BmiHvsALDi87QMS?= =?us-ascii?Q?S3YFugQOwf+eoHxqE4VmwXcDUBGrPxIsQycXbL9?= =?us-ascii?Q?1=2F4y3j=2FoxzXzkCGFhsx=2FBY2t2zxOFyavnucqWzq?= =?us-ascii?Q?fSBSalVYgoyLEi=2F8H2vMsDgBEw=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: ZQTAL6G4T5TPOJZEQMFG63KPQPVKQ52T X-Message-ID-Hash: ZQTAL6G4T5TPOJZEQMFG63KPQPVKQ52T 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.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:117633] [Ruby master Misc#20441] Should passing keyword args to method_name(*) be an error? List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "ozydingo (Andrew Schwartz) via ruby-core" Cc: "ozydingo (Andrew Schwartz)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20441 has been updated by ozydingo (Andrew Schwartz). Why does this conversion to a Hash occur? I would guess for some sense of backward compatibility with gems / code written in earlier versions of Ruby. But #20440 demonstrates why this compatibility is not achieved. To be clear, I'm not arguing it _should_ be backward compatible, and it isn't; but they why should `*` convert keyword args to a Hash instead of considering it an error? `super` only comes into play because that's the only time you'll silently pass the converted arg in code that might not be compatible with doing so, such as in the linked example. Without `super` the args are simply unused. ---------------------------------------- Misc #20441: Should passing keyword args to method_name(*) be an error? https://bugs.ruby-lang.org/issues/20441#change-108041 * Author: ozydingo (Andrew Schwartz) * Status: Open ---------------------------------------- In the following method: ```rb def foo(*) super end ``` it is apparently the intended ruby 3 behavior to pass keyword args as a positional Hash to `super`. I believe this is confusing and can lead to hidden and hard-to-discover bugs (e.g. #20440). Since `*` is meant to only represent positional args, should it be an ArgumentError to pass keyword args at all to this method? Similar to how it is an error to pass positions args to `bar(**)`. -- 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/postorius/lists/ruby-core.ml.ruby-lang.org/