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 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 048A91F731 for ; Fri, 9 Aug 2019 02:13:32 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 10B05120AC1; Fri, 9 Aug 2019 11:13:25 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 3F544120ABC for ; Fri, 9 Aug 2019 11:13:23 +0900 (JST) Received: by filter0105p3las1.sendgrid.net with SMTP id filter0105p3las1-18192-5D4CD6C5-27 2019-08-09 02:13:25.836647307 +0000 UTC m=+1147734.186476299 Received: from herokuapp.com (unknown [52.90.173.208]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id QsHIGp7GR62Wy_9GC1XJrA for ; Fri, 09 Aug 2019 02:13:25.807 +0000 (UTC) Date: Fri, 09 Aug 2019 02:13:25 +0000 (UTC) From: ko1@atdot.net Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 69755 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15877 X-Redmine-Issue-Author: danielwaterworth X-Redmine-Issue-Assignee: ko1 X-Redmine-Sender: ko1 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-SG-EID: =?us-ascii?Q?fVTMYOBjtdvXNcWwrscBhLsHItUXVK5L4mtnq0mdcRfmqE7LdBkbTjknJDGkDa?= =?us-ascii?Q?g6o4uCIvGyT9b7N15RleD5ibzuUSOB8JmVr8vxq?= =?us-ascii?Q?X6nJKYoExgGFUQbS2+9Pdk3V+vTArJI=2FZUc7Ows?= =?us-ascii?Q?Kg9ClTPmao6ctp05hHKdwMhjembwcME1UrEpalm?= =?us-ascii?Q?wZdGFcGllWTEp?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 94211 Subject: [ruby-core:94211] [Ruby master Bug#15877] Incorrect constant lookup result in method on cloned class X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15877 has been updated by ko1 (Koichi Sasada). > solve "duplicate :raise event" [Bug #15877] sorry my mistake :p ---------------------------------------- Bug #15877: Incorrect constant lookup result in method on cloned class https://bugs.ruby-lang.org/issues/15877#change-80509 * Author: danielwaterworth (Daniel Waterworth) * Status: Closed * Priority: Normal * Assignee: ko1 (Koichi Sasada) * Target version: * ruby -v: 2.6.3 * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: REQUIRED ---------------------------------------- This behavior seems wrong to me: ``` ruby class Foo def test TEST end end Bar1 = Foo.clone Bar2 = Foo.clone class Bar1 TEST = 'bar-1' end class Bar2 TEST = 'bar-2' end # If these two lines are reordered, 'bar-2' is produced each time p [:bar1_method, Bar1.new.test] # outputs 'bar-1' (correct) p [:bar2_method, Bar2.new.test] # outputs 'bar-1' (incorrect) p [:bar1_const, Bar1::TEST] # outputs 'bar-1' (correct) p [:bar2_const, Bar2::TEST] # outputs 'bar-2' (correct) ``` Possibly related to #9603, #7107 -- https://bugs.ruby-lang.org/