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-Status: No, score=-3.8 required=3.0 tests=AWL,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 758E41F4B4 for ; Thu, 14 Jan 2021 20:48:39 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id A4452120B08; Fri, 15 Jan 2021 05:47:47 +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 DB00D120AFE for ; Fri, 15 Jan 2021 05:47:44 +0900 (JST) Received: by filterdrecv-p3mdw1-5fdf7d7776-7xtf5 with SMTP id filterdrecv-p3mdw1-5fdf7d7776-7xtf5-20-6000AE20-D 2021-01-14 20:48:32.20339772 +0000 UTC m=+179391.196081416 Received: from herokuapp.com (unknown) by ismtpd0090p1iad2.sendgrid.net (SG) with ESMTP id YjaX5tAvTIyclkqPZyaF0g for ; Thu, 14 Jan 2021 20:48:32.148 +0000 (UTC) Date: Thu, 14 Jan 2021 20:48:32 +0000 (UTC) From: merch-redmine@jeremyevans.net Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 78000 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17423 X-Redmine-Issue-Author: matz X-Redmine-Issue-Assignee: jeremyevans0 X-Redmine-Sender: jeremyevans0 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?RVE3t853K5scBhbmJHUzZTFFeVC=2FZSUmHZ0Dc+26wcEi2CTgsF1oz0wTSSxGGN?= =?us-ascii?Q?BIXh18dTx0UQRGoHJjYQ=2FL57e3gNHUptT03dnb5?= =?us-ascii?Q?AvVkTvk6t6l3IXef5fWCGrK+WKNQVuKgN+GEQt=2F?= =?us-ascii?Q?ZOdg8IlVMhACSCavGw+Rg6w3LrVFSXU83lMRJ8l?= =?us-ascii?Q?GpxPRc8CKKwamGnvmQbyDewpQuw8M0DFIm4Z=2F=2F5?= =?us-ascii?Q?tUFyVo7=2FrmQBks5aI=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 102097 Subject: [ruby-core:102097] [Ruby master Bug#17423] `Prepend` should prepend a module before the 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 #17423 has been updated by jeremyevans0 (Jeremy Evans). Based on the decision made at the developer meeting (https://github.com/ruby/dev-meeting-log/blob/master/DevelopersMeeting20210113Japan.md#bug-17423-prepend-should-prepend-a-module-before-the-class-jeremyevans0), I've added a pull request that will make Module#prepend insert a module in the ancestor chain even if the receiver already includes the module: https://github.com/ruby/ruby/pull/4072 ---------------------------------------- Bug #17423: `Prepend` should prepend a module before the class https://bugs.ruby-lang.org/issues/17423#change-89954 * Author: matz (Yukihiro Matsumoto) * Status: Open * Priority: Normal * Assignee: jeremyevans0 (Jeremy Evans) * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- I see ```ruby module M; end module A; end class B; include A; end A.prepend M B.prepend M p B.ancestors ``` gives `[B, M, A, Object, Kernel, BasicObject]` now. It used to be `[M, B, A, Object, Kernel, BasicObject]`. I think it should be prepended to class `B`. Probably it should be `[M, B, M, A, Object, Kernel, BasicObject]`. The reason behind this change may be duplication removing, but considering the following code, it is OK to duplicate prepende modules. ```ruby module M; end class A; end class B [M, B, M, A, Object, Kernel, BasicObject] ``` Am I missing something? Matz. -- https://bugs.ruby-lang.org/