From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id E5BB91F8C6 for ; Sun, 8 Aug 2021 13:09:41 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 66B281209F6; Sun, 8 Aug 2021 22:08:20 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 987081209F6 for ; Sun, 8 Aug 2021 22:08:18 +0900 (JST) Received: by filterdrecv-7c9f9f88f-krpl8 with SMTP id filterdrecv-7c9f9f88f-krpl8-1-610FD786-11B 2021-08-08 13:09:26.940959325 +0000 UTC m=+1104578.018707110 Received: from herokuapp.com (unknown) by geopod-ismtpd-2-2 (SG) with ESMTP id 3tbv2pFpRhamObsPeDVpfg for ; Sun, 08 Aug 2021 13:09:26.929 +0000 (UTC) Date: Sun, 08 Aug 2021 13:09:26 +0000 (UTC) From: info@ttanimichi.com Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 18067 X-Redmine-Issue-Author: ttanimichi X-Redmine-Sender: ttanimichi 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: 80968 X-SG-EID: =?us-ascii?Q?GULVqlHThXsypk0LrcL3iR0SSuviswI2AfP7Si5YEnmqhwjB2WeEVj+s2mK8rM?= =?us-ascii?Q?5VcItVlB5FwZqLWTrdiF4WTiU7Hzm4dFzQ4gzSU?= =?us-ascii?Q?osnjcEPZcqBA7opXrGtUMvLw0QRISsi3plZ0ixH?= =?us-ascii?Q?x8RQrYV2p75Or0fUrY=2FYuts4j4x6YWYwFVGa1T5?= =?us-ascii?Q?en4V+9qOdnFaUcdkf0drcWdYsQ=2FcR0Q46Uw=3D=3D?= To: ruby-dev@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-dev X-Mail-Count: 51088 Subject: [ruby-dev:51088] [Ruby master Bug#18067] Composite procs with `instance_exec` aren't executed within the context of the receiver X-BeenThere: ruby-dev@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: "Ruby developers \(Japanese\)" List-Id: "Ruby developers \(Japanese\)" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-dev-bounces@ruby-lang.org Sender: "ruby-dev" Issue #18067 has been reported by ttanimichi (Tsukuru Tanimichi). ---------------------------------------- Bug #18067: Composite procs with `instance_exec` aren't executed within the context of the receiver https://bugs.ruby-lang.org/issues/18067 * Author: ttanimichi (Tsukuru Tanimichi) * Status: Open * Priority: Normal * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- ```ruby func1 = -> (x) { x + y } class A def y 10 end end A.new.instance_exec(1, &func1) # => 11 func2 = -> (x) { x * 2 } f = func1 >> func2 A.new.instance_exec(1, &f) # => undefined local variable or method `y' for main:Object (NameError) ``` -- https://bugs.ruby-lang.org/