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, T_SCC_BODY_TEXT_LINE 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) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id B30A41F406 for ; Tue, 26 Dec 2023 17:57:38 +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=jKkw0o4F; 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=be0/newj; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 848A4819B4; Tue, 26 Dec 2023 17:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1703613449; bh=pOq7FAHgjf1KxC2PMCIn9gUJs/KRDmNCSyrGcpMmKaM=; 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=jKkw0o4FzL2gthxQSU1zQlw9F+qqu/XDWE2RzsgdxkwwLrJxDnPU2czKlqpixrgXQ kpVWI2smzXPan6XT9+2EsAlZ2MHW2T5Grk8yErq1sDoHGcU0nKgls/TjbW8KbenYbN i8Ol5qIWI7jrEYRtMtFXG8ViStpWb7i+5qRV1iL8= Received: from wrqvtvvn.outbound-mail.sendgrid.net (wrqvtvvn.outbound-mail.sendgrid.net [149.72.120.130]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 4D70281985 for ; Tue, 26 Dec 2023 17:57:26 +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=be0/newj; 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=cX6mI3gBKc4jfFQ8R5BTmJ0zYPeSl41VsZT/SVMqbp4=; b=be0/newjMIJ0Bk+VRVn4c77JJp+OMhO1wi1mK01MClQDW7P4Uun2/7rx1ZjuQpJ5Q7ks 9ERi8nxVp0tfFvZ2y/Acb8SoxztDLq0I8dC8N56+k7+6sMSJt32Cniwr0m++TFG3M3rLba jcYxyWCBa4hilwgKu0C8dW59fIrndf+vNpLY48W27kgCblPHCkG+FpX3t172mNLP5RezrH 1BKnr9UpdQ6ZqEON6+nLFYaRuQNxxLekj+8HeWzayno25NeXSP6ZGYBsYF5Bc+3kg5H7jw LpiRFrn2uPqnCOYPgwfu6N938Id/o8AaCfiMEWSvPXtYLYQ/em4G2ZWvDaNKjpjA== Received: by filterdrecv-656b5b4c75-zckst with SMTP id filterdrecv-656b5b4c75-zckst-1-658B1405-6 2023-12-26 17:57:25.126934486 +0000 UTC m=+6045452.055663970 Received: from herokuapp.com (unknown) by geopod-ismtpd-20 (SG) with ESMTP id gYoMr5DmSJibyP2Q9UDECg for ; Tue, 26 Dec 2023 17:57:25.084 +0000 (UTC) Date: Tue, 26 Dec 2023 17:57:25 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20090 X-Redmine-Issue-Author: willcosgrove X-Redmine-Sender: willcosgrove 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: 92443 X-SG-EID: =?us-ascii?Q?6hNzdrDZ6c5jM+dOxePgZN0=2FTwgzsW9eGVndzDfPRDB=2FDaaa1EPFVTX0rmRx6i?= =?us-ascii?Q?+RYeTstmw=2FkhMFA2NfmOjnmMZMdYO805tJZU4mr?= =?us-ascii?Q?03xKkI7LNOVYIv4XP6Gs5d5+5Yj3SDgWcd9r7Bh?= =?us-ascii?Q?QTozn3IzXG7mGvvPlezaJURS03C6d4xNWiGuxcv?= =?us-ascii?Q?OQmk6nfS1gozLgXz4X3Aqq7=2FX7Ez1KswCeFQHsY?= =?us-ascii?Q?snYADFAF4oxubzWK0m06vVUp5GPDZKyuZW5LfHp?= =?us-ascii?Q?sVrI43TLlRLWtMnMBm=2F+Q=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: B5A3ANZN5J3CQYRTFNH637TQHNQAMOX6 X-Message-ID-Hash: B5A3ANZN5J3CQYRTFNH637TQHNQAMOX6 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:115912] [Ruby master Bug#20090] Anonymous arguments are now syntax errors in unambiguous cases List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "willcosgrove (Will Cosgrove) via ruby-core" Cc: "willcosgrove (Will Cosgrove)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20090 has been reported by willcosgrove (Will Cosgrove). ---------------------------------------- Bug #20090: Anonymous arguments are now syntax errors in unambiguous cases https://bugs.ruby-lang.org/issues/20090 * Author: willcosgrove (Will Cosgrove) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- It looks like the changes that were made in #19370 may have gone further than intended. It's also possible I'm misunderstanding what decision was made. But it was my understanding that the goal was to make ambiguous cases a syntax error. The test cases added are all testing the ambiguous cases: ```rb assert_syntax_error("def b(&) ->(&) {c(&)} end", /anonymous block parameter is also used/) # ... assert_syntax_error("def b(*) ->(*) {c(*)} end", /anonymous rest parameter is also used/) assert_syntax_error("def b(a, *) ->(*) {c(1, *)} end", /anonymous rest parameter is also used/) assert_syntax_error("def b(*) ->(a, *) {c(*)} end", /anonymous rest parameter is also used/) # ... assert_syntax_error("def b(**) ->(**) {c(**)} end", /anonymous keyword rest parameter is also used/) assert_syntax_error("def b(k:, **) ->(**) {c(k: 1, **)} end", /anonymous keyword rest parameter is also used/) assert_syntax_error("def b(**) ->(k:, **) {c(**)} end", /anonymous keyword rest parameter is also used/) ``` However it is now also producing syntax errors in all of these cases: ```rb def b(&) -> { c(&) } end def b(*) -> { c(*) } end def b(a, *) -> { c(1, *) } end def b(*) ->(a) { c(a, *) } end def b(**) -> { c(**) } end def b(k:, **) -> { c(k: 1, **) } end def b(**) ->(k:) { c(k:, **) } end ``` Again, it's possible I misunderstood the scope of the previous change. But it would be sad to lose the unambiguous case, as I've used that pattern quite a bit in my own projects. This is my first time opening an issue here, so I apologize in advance if I've done anything non-standard. -- 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/