From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on starla X-Spam-Level: X-Spam-Status: No, score=0.4 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 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=O8EtLP5y; 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=qbjqH/+b; dkim-atps=neutral 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 1F9731F6CC for ; Tue, 16 Sep 2025 10:16:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1758017799; bh=DCfvb2jEGJ/+PzUr3rysr3RFSdj/vWux16SnNAolSaI=; 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=O8EtLP5yCmxSQFMPSAKO7wHCUdrAS0rgr7eRPCGnLVIhEAKkBTGF+CkuT8szoD9O2 6UsCokcLzje7F/pmCZMNzHbqDbRO5uzBSDqhKhiMINryDmE71SMrn9c8qAR2lsfhTy MZiYy0Pz9Pp9KfylFDIJASXLScXeGqQe8MuAyvoM= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 8876248EFF for ; Tue, 16 Sep 2025 10:16:39 +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=qbjqH/+b; 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 375B142E03 for ; Tue, 16 Sep 2025 10:15:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=date:from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:date:from:subject:to; s=s1; bh=GHUrRATRupveiv2P8oNjnSMDOq21/xxmHNHzCzeV/88=; b=qbjqH/+bhY1BFzPMYoBlcfQkKfTcRjeuarVFja4MhNmNR1ok/P9g1BT2MjfT3AJPsrLb gBPZ7gjzdLT1IWPxucuBpFCr+Q3JLJgNZMLLvcNGDYNfkCvpic1t9HencQ6opRb+ajlo8T JKA8I82t+jLQg+tEfJa8xz0bUnbbsArHIquHKM/vZ1o83XPc4yKwFg3TW8u2LnxkVFywaV dtVH31CaNfcRZLzbji8QaYzsDccMQ2j4883YLc2ktIzBtEefurjEVRyfoCFv3aMMMV6Q8N tx/UkX7DcYmU/xEpRiQKLhMShQeVr1HzyboO17SqT/cr73MnJQ8zn8GjPJs1jYZw== Received: by recvd-769f975875-t8bjd with SMTP id recvd-769f975875-t8bjd-1-68C938C4-35 2025-09-16 10:15:32.908297604 +0000 UTC m=+1163498.847499125 Received: from herokuapp.com (unknown) by geopod-ismtpd-16 (SG) with ESMTP id lpnPqHSfR62GraPQJD_ZBA for ; Tue, 16 Sep 2025 10:15:32.890 +0000 (UTC) Date: Tue, 16 Sep 2025 10:15:32 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 21572 X-Redmine-Issue-Author: kddnewton X-Redmine-Issue-Priority: Normal X-Redmine-Sender: Earlopain 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: 100088 X-SG-EID: =?us-ascii?Q?u001=2EeN8dK4P86Am4z06GVDKdfuyUr=2FYDMIW0L=2F3i+rfu20a8IqvHXr8dkK0nT?= =?us-ascii?Q?JnNCPZBfBfcBXIzVHSukhq0Fst8w76lX7vgcOKR?= =?us-ascii?Q?zLI=2FaLZlFeJV540=2FieoCjogCQLhgppSlTbM0i22?= =?us-ascii?Q?oiRmZaXsao3OJw6qeGfP=2FlDj3XHSUws+EV0pKg5?= =?us-ascii?Q?cU99G4Ahi1XD9gEkcccBoJjfW5scn5Fb5hwQb+F?= =?us-ascii?Q?ZyKg3kV6+NSoJmeoLoiZQIGkuSZxjVbELJnwXpS?= =?us-ascii?Q?gVzDw=2Fw14RSudPOC3sqzBkb6fA=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: 7RALEO4YBR7SSKTESVSOUQ7PENWPQ47J X-Message-ID-Hash: 7RALEO4YBR7SSKTESVSOUQ7PENWPQ47J X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:123259] [Ruby Feature#21572] Make illegal variable in alternation pattern a syntax error List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "Earlopain (Earlopain _) via ruby-core" Cc: "Earlopain (Earlopain _)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #21572 has been updated by Earlopain (Earlopain _). Thanks for opening this. It seems just like a normal though, no? I understand that this doesn't deviate from what parse.y does but it is a syntax error and right now consumers of prism simply accept such code. I guess there are tests in ruby/ruby that very specifically assert against this somehow? Other than that, is seems like an implementation detail. ---------------------------------------- Feature #21572: Make illegal variable in alternation pattern a syntax error https://bugs.ruby-lang.org/issues/21572#change-114625 * Author: kddnewton (Kevin Newton) * Status: Open ---------------------------------------- Currently when you have an illegal variable in an alternation pattern, you get a compile error, but no syntax error. ```ruby case foo in {a: } | Array "matched: #{a}" end ``` yields ``` $ ruby -cv test.rb ruby 3.5.0dev (2025-04-10T10:21:51Z master 756479324f) +PRISM [x86_64-linux] Syntax OK ``` but ``` $ ruby test.rb test.rb:2: illegal variable in alternative pattern (a) test.rb: compile error (SyntaxError) ``` Looking at the compiler, since illegal jumps (like break, next, etc.) are now syntax errors, the only other actual compiler errors are related to builtins. I think this should be a proper syntax error, so that editors and other tools can report on it and users can find it in development sooner. -- 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/