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=-1.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,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=wovJwXel; 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=LABcj1vo; 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 9CC2B1F47D for ; Wed, 17 Sep 2025 16:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1758127560; bh=7w2VK9eKYjs8aRNjVYrxW2X2hE4RMcf7johth5TbCoQ=; 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=wovJwXelKhkYUyzQ80/ij1m0pIVn0qUInHM/BWm85eiLE7gj2yrh7HNh7XMdNMi9w i9jHU3+QN8q/r99O0jXxjwzExjW8NvpsPOy4Sitdd8gW+iTVEQDwFS9XLm+czDKte9 +iHob0aksY8FLaknFfDyV6hzbqdUYNnQgkfEv5YU= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 218C548F45 for ; Wed, 17 Sep 2025 16:46:00 +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=LABcj1vo; dkim-atps=neutral Received: from s.wfbtzhsw.outbound-mail.sendgrid.net (s.wfbtzhsw.outbound-mail.sendgrid.net [159.183.224.105]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 9564E42DBF for ; Wed, 17 Sep 2025 16:45:02 +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=z+82HHOgGyZlXS8ac/HU7SpPP+X0gg+0DSsEMwxFKEo=; b=LABcj1voNrXlRJcd8e+UNDQGMMVcUURcF5hNTw7vB22KgZnmonajP8EE4IPrq/J3dDZ2 jElzVRh5bSeEkjKUxoxr02x12twKUWFE+rUbwN3tw3DwyPVAdO/5vYFrF82xo7+CAtllru Ua2znlwSmpCte8oze1zqM0iGCghzKyr0BNjE2U8uGQ4mJixS4mA945wQ9FgiePx+K9o/Kc GepXmuYc4plQLeWzCmzdMGZKcKuWeBoOBAc/M+iPlMHIgZk6UQ4JtWZd1FeMvf4ahe7C9p tWciMbxAEJkV+07LFMDES8DcSjgCPgMLmQdKbwe2800V9HpKbkFw/Zt+5tEXrSPw== Received: by recvd-6f5cbff5dc-6rwjf with SMTP id recvd-6f5cbff5dc-6rwjf-1-68CAE58D-2A 2025-09-17 16:45:01.500515942 +0000 UTC m=+1289052.610480754 Received: from herokuapp.com (unknown) by geopod-ismtpd-4 (SG) with ESMTP id i23TkOFAQ0GDqWjCe4W8zw for ; Wed, 17 Sep 2025 16:45:01.463 +0000 (UTC) Date: Wed, 17 Sep 2025 16:45:01 +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: kddnewton 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: 100116 X-SG-EID: =?us-ascii?Q?u001=2E41nWPij=2FD1kdGmpgWeHScbb9X8tZePZrQQx3bl8Vy2odBuMhLMhId2kIq?= =?us-ascii?Q?I4MmMJ43lNHfKPNNds=2Fb3JsTYpYoWyQb3+sPV4d?= =?us-ascii?Q?vscaSKwkBzXcGvARmBntMAirPscPYPYgU0hUhrl?= =?us-ascii?Q?rrofgncI10IJjMf0=2FDsjDGYXUdrLb9UOUM8gw9O?= =?us-ascii?Q?xSxtW8M3RR86k8yYbq=2FKejWQAPSPGUqUTRbnfoF?= =?us-ascii?Q?mYOX5wQ7nZRgAsoypCHiNI6nYSMb1wnLMpTV3Eg?= =?us-ascii?Q?XfCto9WE2FSKgQSGyqiXowpA2Q=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: F56PJRMCAAM2FZQOR4XABQOMK5VU3SWH X-Message-ID-Hash: F56PJRMCAAM2FZQOR4XABQOMK5VU3SWH 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:123283] [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: "kddnewton (Kevin Newton) via ruby-core" Cc: "kddnewton (Kevin Newton)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #21572 has been updated by kddnewton (Kevin Newton). I agree, but there's precedence here of some things only being detectable at run-time, like illegal `break` usage. I just want to make sure this change goes through the proper channels to make sure everyone is onboard. ---------------------------------------- Feature #21572: Make illegal variable in alternation pattern a syntax error https://bugs.ruby-lang.org/issues/21572#change-114654 * 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/