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.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, SPF_HELO_PASS,SPF_PASS autolearn=ham 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=k4eJRXLm; 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=jADwUQQ1; 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 B5AEDD484A for ; Tue, 21 Oct 2025 15:47:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1761061612; bh=6IXkoatrsYCv4mg4YZM1o+mtsGOR2PNE53ySYCkSx+o=; 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=k4eJRXLm9KAMa4SJvRgIHexM/WVpmUW+CrxvmdsT4wAauRUnDHTffwwa8Yqbeomay QqxGjsXFKiVOy+Fyr9RqYiFxSgCPmidM1/2ViR0Ot+e61VGLk+7fzX0uGaxBLq9C4t LVoVvXnAYS06tkC4toqQARyXm7xsA1J7HjBLdH9c= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id E326049217 for ; Tue, 21 Oct 2025 15:46:52 +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=jADwUQQ1; dkim-atps=neutral Received: from s.wrqvtvvn.outbound-mail.sendgrid.net (s.wrqvtvvn.outbound-mail.sendgrid.net [149.72.120.130]) by nue.mailmanlists.eu (Postfix) with ESMTPS id D6DCA4914F for ; Tue, 21 Oct 2025 15:45:51 +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=JkGG6lobCV+ppp+mkeRN7ADNM5yze6UnrpNroFpxjfA=; b=jADwUQQ1/6xzqEWWLArRZykSIpc6qe3028ZdaFa70rJukSf6rQLBEjPpdoJBLNhMbO+1 pncblXALTi6nnVdf1IbEaJH46QbOIGRy6FRcid0zwrWRnu7bGMSOVOnRmi6VogS+up8Cgm Zmar1MsQvJ/ZajHhkQ1jOSyyVPB/nF33ghvtv7zv/skmKB7s3VGIjCImqGFjSu91zp/8AJ I/oJPtq+MLQOVYJ3EBvwL0P+hVuJeKOBCCsztrBmYzfNqlWuqCrXzsmnHwcyFl0XzODcdv wBeJDpzz7W9YWJ++BPD5oxN9uXZbfZ0kWBJ3vHqrFUaZz+E3jFFcrIvBX5OI4fKA== Received: by recvd-686fbc5d8-bw57j with SMTP id recvd-686fbc5d8-bw57j-1-68F7AAAD-42 2025-10-21 15:45:49.979418849 +0000 UTC m=+12006108.637027353 Received: from herokuapp.com (unknown) by geopod-ismtpd-26 (SG) with ESMTP id 2HFT6GDVR5yAXmNw7y54IA for ; Tue, 21 Oct 2025 15:45:49.954 +0000 (UTC) Date: Tue, 21 Oct 2025 15:45:50 +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: ktsj 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: 100333 X-SG-EID: =?us-ascii?Q?u001=2ES007+tYskRPXzZ8EVDbnaSR8Lgwq75RZTPDdD6A4Mi=2FdYQev6C7actQcI?= =?us-ascii?Q?AwCAn3sDM7gUDClecmh3EVQNmc6OeFDnhZRUard?= =?us-ascii?Q?q1b4jgw6VYUJ+8VdJYrt+0+JJQBkK5chDonfvwW?= =?us-ascii?Q?7s5BAlmOitmHHvXpDLKAkwaN2Coh8uV0pPCXRH=2F?= =?us-ascii?Q?d1OiLNkMBssZU3ixSn5b2PB6Q5sr6F7nrI86vig?= =?us-ascii?Q?tYIUvaMPDtaMG9qDoW3wX9FK25O2mK34OFzoC81?= =?us-ascii?Q?F4bFTLUnKW1wnzPziRgLtI6DOg=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: FRBG6DZL4AUGR6KUWWYG3DDJ7LWDJEMJ X-Message-ID-Hash: FRBG6DZL4AUGR6KUWWYG3DDJ7LWDJEMJ 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:123511] [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: "ktsj (Kazuki Tsujimoto) via ruby-core" Cc: "ktsj (Kazuki Tsujimoto)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #21572 has been updated by ktsj (Kazuki Tsujimoto). I agree with you, @kddnewton. Your proposal makes sense. ---------------------------------------- Feature #21572: Make illegal variable in alternation pattern a syntax error https://bugs.ruby-lang.org/issues/21572#change-114884 * 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/