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 [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 215721F4CC for ; Tue, 24 Dec 2024 12:52:37 +0000 (UTC) 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=0B3YcWTt; 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=pIUxFj6E; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1735044754; bh=8loK47T2xrwbsSju3Sknv+oNPKXFk1KexbRB7ScvdF8=; 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=0B3YcWTt/stlKmwTt6+fwi7QkANkgbwsUdRB/Q44V/Ida+Jz0iqHpXxptKB5DZH7e M2tX/TGBHWKlOvLdG0HifBhA6E0dpCxMRwpS5lOhrgEsabf2vHYOEUJbwW/qlmGc6u C0XmfRd5eCCyjzBnA4IKJvTs8xe6ZSA/dss8cfSU= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id DDD3345F3E for ; Tue, 24 Dec 2024 12:52:34 +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=pIUxFj6E; dkim-atps=neutral Received: from s.wfbtzhsv.outbound-mail.sendgrid.net (s.wfbtzhsv.outbound-mail.sendgrid.net [159.183.224.104]) by nue.mailmanlists.eu (Postfix) with ESMTPS id EFFF445F34 for ; Tue, 24 Dec 2024 12:52:30 +0000 (UTC) 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=69C0fJa6UB/qkE+SDdKD+LyE/q8WvxVmYl+MAGHKEhg=; b=pIUxFj6Esd/IsX/QmV+AKsXNKY0jczRs9V2srlnSEIlWIlZkL02gzH+PMRhcG2CLs28M u9aRYlLl8b/r1Yv16CSA/e5tMAdP/DkDOSGVYwACGBSZQ522U7cYKg4yhMtcvdQu+CAXOM WsBzyjr5mYxWyW1u392P+K4mSI/zRRmUDlwQRGD2sMsjEgznSXC8VRKUgUNNUAfgxBX3wV vcny00tBYzxcZotdVW/ZsIFLrshJWo0QsOLzir5x5fV9idvUgQclDCAv4tArn9TeXZdPtK PaSU2yQr2kvxef/A2Gqx4oP98jXsXMQ2jjWeEGGiFzMQ50+sbPnl4oHRD+n/Kqxg== Received: by recvd-5f9ffdf494-9p2dl with SMTP id recvd-5f9ffdf494-9p2dl-1-676AAE8D-F 2024-12-24 12:52:29.679183882 +0000 UTC m=+3425592.971725155 Received: from herokuapp.com (unknown) by geopod-ismtpd-2 (SG) with ESMTP id 7iSU04tkRRyayflQcRn3uw for ; Tue, 24 Dec 2024 12:52:29.673 +0000 (UTC) Date: Tue, 24 Dec 2024 12:52:29 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20970 X-Redmine-Issue-Author: tompng X-Redmine-Issue-Priority: Normal X-Redmine-Sender: Eregon 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: 97070 X-SG-EID: =?us-ascii?Q?u001=2EByjZWvxTCjdoV8K03xEuhE7KqN4thWULFLM7+oH78KY30oYB3qFthsDpL?= =?us-ascii?Q?4w4cbYa3ttBh8bAHPOnE=2FkzPba67JNu7Lnrked2?= =?us-ascii?Q?O7K9VQ=2FJax12626Pe1F=2F4jM8xHV0zM79zfhdPAI?= =?us-ascii?Q?7VYwQ9jvXQrgyiNrIBMkWc1qIXnbOxxqyJLuw9c?= =?us-ascii?Q?L0OQTZBi1C44gwXQd2sustJH+BfiMErMLqogKU0?= =?us-ascii?Q?Oy32uWDaCooAH1rFQyhDJe6T4Fdnb0WbKLLlw5Z?= =?us-ascii?Q?OSgen9H1r4i3maaGSgpOD6qGLA=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: 675VMPX6VDRYJKJTDFI3GV6E5E4EGZTO X-Message-ID-Hash: 675VMPX6VDRYJKJTDFI3GV6E5E4EGZTO 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.9 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:120393] [Ruby master Bug#20970] `it /1/i` raises undefined method 'it' for main (NoMethodError) even if binding.local_variables includes `it` List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "Eregon (Benoit Daloze) via ruby-core" Cc: "Eregon (Benoit Daloze)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20970 has been updated by Eregon (Benoit Daloze). k0kubun (Takashi Kokubun) wrote in #note-7: > The same applies to `[1].each { p it; [5].each { p it } }`. Prism didn't change the behavior, but `parse.y` should be changed back to print `1` and `5`. Is there a test for this? I guess not as the original PR passed CI, it would be good to add it to avoid regressions there. Testing cases of nested `_1` and mixing `it` and `_1` would be go as well (https://bugs.ruby-lang.org/issues/20930) ---------------------------------------- Bug #20970: `it /1/i` raises undefined method 'it' for main (NoMethodError) even if binding.local_variables includes `it` https://bugs.ruby-lang.org/issues/20970#change-111174 * Author: tompng (tomoya ishida) * Status: Closed * ruby -v: ruby 3.4.0dev (2024-12-19T07:16:12Z master 335bba0fde) +PRISM [x86_64-linux] * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED ---------------------------------------- `it` parameter became a local variable with #20965, but it does not behave like local variable with `--parser=prism` ~~~ruby i=2 42.tap do p it # 42 p local_variables # [:it, :i] p it /1/i # should be 21, got NoMethodError end ~~~ It prints `42`, `[:it, :i], `21` with `--parser=parse.y` -- 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/