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=-4.1 required=3.0 tests=AWL,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,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 81E161F9FD for ; Wed, 17 Mar 2021 01:15:54 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 07136120A9E; Wed, 17 Mar 2021 10:14:56 +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 D444D120A9D for ; Wed, 17 Mar 2021 10:14:53 +0900 (JST) Received: by filterdrecv-p3las1-c477c4585-7p8x7 with SMTP id filterdrecv-p3las1-c477c4585-7p8x7-20-60515845-15 2021-03-17 01:15:49.231626799 +0000 UTC m=+3032873.227474537 Received: from herokuapp.com (unknown) by geopod-ismtpd-6-0 (SG) with ESMTP id 0UAL95_ZTRy_rtVZoj0SIw for ; Wed, 17 Mar 2021 01:15:48.925 +0000 (UTC) Date: Wed, 17 Mar 2021 01:15:49 +0000 (UTC) From: nobu@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 78931 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17725 X-Redmine-Issue-Author: joshuadreed X-Redmine-Sender: nobu 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?q8Dly+pU2+3ektTtZVXgZtbJPXwqo7p86jCsvYTW4BxwWslwlK8c7sepkIyeHJ?= =?us-ascii?Q?oq6GK0BMma=2FLHsamrYtm98OcEYsmcvKqoKBxBYo?= =?us-ascii?Q?LCbsOuVlJ3v74RnHQRZa5KOMG9e+W4YTBtSyfWA?= =?us-ascii?Q?V66UMgDFxd0gsBaDTzsZq+5CwfRhpQSJGz3VjlX?= =?us-ascii?Q?0W+fK8N8MDlmY83Z9Mf9cDirzd=2F2utCq0brtLqK?= =?us-ascii?Q?t9cOsKa8NSxlL=2FmNU=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 102896 Subject: [ruby-core:102896] [Ruby master Bug#17725] Prepend breaks ability to override optimized methods 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 #17725 has been updated by nobu (Nobuyoshi Nakada). nobu (Nobuyoshi Nakada) wrote in #note-4: > Seems the redefinition flag is not set by prepend. This is not accurate, actual method owner class needs to be checked too. ---------------------------------------- Bug #17725: Prepend breaks ability to override optimized methods https://bugs.ruby-lang.org/issues/17725#change-90957 * Author: joshuadreed (Josh Reed) * Status: Open * Priority: Normal * ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- Prepending any module to `String` and `Hash` (and possibly other or all classes?) blocks the ability to `alias` As an example: ``` ruby module Dummy; end # String.prepend(Dummy) class String alias_method(:old_plus, :+) def + other puts 'blah blah' old_plus(other) end end 'a' + 'b' > blah blah ``` ``` ruby module Dummy; end String.prepend(Dummy) class String alias_method(:old_plus, :+) def + other puts 'blah blah' old_plus(other) end end 'a' + 'b' > ``` Prepending after an `alias` does not affect the previous `alias` -- https://bugs.ruby-lang.org/