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=0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET,SPF_HELO_PASS, SPF_PASS autolearn=no 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 2219D1F4D0 for ; Fri, 20 Dec 2024 05:28:47 +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=LX4WTl+r; 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=XtVllxuO; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1734672524; bh=qixirFz5FjM/QhuUnZpdlp5Hfww557nzs9Yb0Za2/fo=; 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=LX4WTl+rh9CDy9/kn7pw0MJMKrKBmFEUvQUTIO/sS+bbJjdyZa0HyXOBr71KPydfo iAdNytU/jgcDfx4T7xiF5sf6Q2AkE+NSmzmts0+CRYUE2nEvsOntAvzhOyHj2dEeHr p2YpWyiVIyUnNd8eDe9rfDtQXwLt7GW6AuDXE1yY= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 9074E44E71 for ; Fri, 20 Dec 2024 05:28:44 +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=XtVllxuO; dkim-atps=neutral Received: from s.wrqvtzvf.outbound-mail.sendgrid.net (s.wrqvtzvf.outbound-mail.sendgrid.net [149.72.126.143]) by nue.mailmanlists.eu (Postfix) with ESMTPS id CCE0B44B62 for ; Fri, 20 Dec 2024 05:28:40 +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=+mMkczlNCj/py4kAKwyF30Tu2NdfpTsIsLcnKr75Z+A=; b=XtVllxuOBfWbw6Yba5x+V1Zwjs52of1UT3EHFwGCtVNh4TgVANYYRhISHnEQwoAviwDc rXMK+wfvqcEzwCVYTGGKmDQLrmps82kJBXTRwExpsYZL0o2PrkwgjkFRf/zH3SrGc9wHrv Br814HYtVrUwSCfSKOmJiYgkg4NjIICAt+LdSvxJgOCb7N46j3+wYUWEBpshPz7zQqd3Co PWGaPHzQDfRwOGXNDcBMmWEtI7G9tDplL4GI68TTHpXa+Qt67G/RQ8eq3lofBB4ZHEsf3f DWetrJeq/p3LmmdwXACYcOya9aTW3bAsH31H2sOEUzqUa1ZjiropXaIKwYdKnPNw== Received: by recvd-canary-54b46787-46ctl with SMTP id recvd-canary-54b46787-46ctl-1-67650087-12 2024-12-20 05:28:39.408672774 +0000 UTC m=+3061245.210944378 Received: from herokuapp.com (unknown) by geopod-ismtpd-18 (SG) with ESMTP id kClqlu9rQGmcgupTzg6GWg for ; Fri, 20 Dec 2024 05:28:39.401 +0000 (UTC) Date: Fri, 20 Dec 2024 05:28:39 +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-Assignee: Group (prism) X-Redmine-Issue-Priority: Normal X-Redmine-Sender: tompng 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: 97017 X-SG-EID: =?us-ascii?Q?u001=2E6lsr3vWETlnb7CBjJOIVTeDyJi+6PdirmC=2FsKYr6MUleSZrjBxRsGPCJC?= =?us-ascii?Q?i9WOL5Su0kL3wxEGMWtXRNWLbnUY3F6jcf9Xi5o?= =?us-ascii?Q?rvioAGXtTohqSj1+35P2QRROjlHkke9mpy2=2FvCk?= =?us-ascii?Q?16aWjeFls49EIfX3+mEio+XdaOdwA68Pg79heEu?= =?us-ascii?Q?b4iRTuMqzj3nAFXvJslmlFWmTC=2FSzYbhlMPvK=2FK?= =?us-ascii?Q?KOYNWoGrYRJQ9yiPAn6TXlBFUQ=2FmPwL6hwBP4uS?= =?us-ascii?Q?kbKMKay60Lyjiy=2F4c1EfwVseVQ=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: QKJ645I4DHIJJGD6TB64XLZSFJDBNTXF X-Message-ID-Hash: QKJ645I4DHIJJGD6TB64XLZSFJDBNTXF 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:120340] [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: "tompng (tomoya ishida) via ruby-core" Cc: "tompng (tomoya ishida)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20970 has been updated by tompng (tomoya ishida). The behavior of nested `it` discussed in #20930 has changed with #20969 ~~~ [1].each { p it; [5].each { p it } } # 1, 5 # --parser=prism, (confirmed by matz at dev meeting?) # 1, 1 # --parser=parse.y (result was 1, 5 before) ~~~ So I think there is a room for discussion to fix prism or to revert the change made to parse.y. ---------------------------------------- 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-111114 * Author: tompng (tomoya ishida) * Status: Open * Assignee: prism * 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/