From: eregontp@... Date: 2020-11-21T12:25:05+00:00 Subject: [ruby-core:101004] [Ruby master Bug#10845] Subclassing String 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/ Unsubscribe: