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=-2.6 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=no 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 1BFE71F66F for ; Sat, 21 Nov 2020 12:31:10 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 2753B120A0C; Sat, 21 Nov 2020 21:30:26 +0900 (JST) X-Greylist: delayed 349 seconds by postgrey-1.34 at neon; Sat, 21 Nov 2020 21:30:24 JST Received: from xtrwkhkc.outbound-mail.sendgrid.net (unknown [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 418B3120A0B for ; Sat, 21 Nov 2020 21:30:24 +0900 (JST) Received: by filterdrecv-p3iad2-5dc87598f5-kxkq4 with SMTP id filterdrecv-p3iad2-5dc87598f5-kxkq4-20-5FB90721-1D 2020-11-21 12:25:05.580703781 +0000 UTC m=+402864.184004079 Received: from herokuapp.com (unknown) by geopod-ismtpd-2-8 (SG) with ESMTP id wLYfgWUTRamjglYrWYCOug for ; Sat, 21 Nov 2020 12:25:05.527 +0000 (UTC) Date: Sat, 21 Nov 2020 12:25:05 +0000 (UTC) From: eregontp@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 76878 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 10845 X-Redmine-Issue-Author: sawa X-Redmine-Issue-Assignee: matz X-Redmine-Sender: Eregon 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?KippOI8ZHtTweq7XfQzW93937kJ4QNWwSBuHnaMEcr1Jl7nM9nsdC7WRJ7=2F44a?= =?us-ascii?Q?a8kwHX0jWJIBFVyyRlkO2t=2FY7rr1yBDzSDTn5SO?= =?us-ascii?Q?SUBiMaBGlACZF96Eer+lZG+eiAg5GhG9HqJ1URo?= =?us-ascii?Q?dgH3A+Mr7n75hEwjwFH6KFVfExR2fepWF1LqW6m?= =?us-ascii?Q?5DzofbP711ardwDyCr+UclqOcXD0uw03AJblXAl?= =?us-ascii?Q?94IvpaO=2F5o=2Fgf9y4Q=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 101004 Subject: [ruby-core:101004] [Ruby master Bug#10845] Subclassing String 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 #10845 has been updated by Eregon (Benoit Daloze). There are far more breaking changes in Ruby 3 than this, so I don't see the point. I guess Rails backported all the keyword arguments changes to previous major versions? Then maybe we can do the same for this. An old release of e.g. Rails 5 already doesn't work on Ruby 3, so there is no point to be compatible with that. I understand being compatible with the latest Rails 5 release makes sense, though. naruse (Yui NARUSE) wrote in #note-16: > I'm serious about the motivation of upgrading to Ruby 3.0 for Rails users. > I worry that so much. I wouldn't worry. If people upgraded to Ruby 2.7, they'll be happy to update to Ruby 3 which has understandable keyword arguments semantics and many other things. I think a lot of people are excited about Ruby 3. If there was a release to worry whether people would upgrade to it it was 2.7, but it seems many people upgraded to it. ---------------------------------------- Bug #10845: Subclassing String https://bugs.ruby-lang.org/issues/10845#change-88673 * Author: sawa (Tsuyoshi Sawada) * Status: Closed * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * ruby -v: 2.2 * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- If I make a subclass of `String`, the method `*` returns an instance of that class. ~~~ruby class MyString < String end MyString.new("foo").*(2).class #=> MyString ~~~ This is different from other similar operations like `+` and `%`, which return a `String` instance. ~~~ruby MyString.new("foo").+("bar").class #=> String MyString.new("%{foo}").%(foo: "bar").class #=> String ~~~ I don't see clear reason why `*` is to be different from `+` and `%`, and thought that perhaps either the behaviour with `*` is a bug, or the behaviour with `+` and `%` is a bug. Or, is a reason why they are different? -- https://bugs.ruby-lang.org/