From: Eric Wong Date: 2018-10-22T18:31:31+00:00 Subject: [ruby-core:89512] Re: [Ruby trunk Bug#15241] net/pop fix to use mutable strings was too eager ``` me@brian-donovan.com wrote: > https://bugs.ruby-lang.org/issues/15241 > See > [[https://github.com/ruby/ruby/commit/3993fbb5f6bfdae0bce040988d7e2dd632247cdc#commitcomment-30987842|this > thread on Github]]. I believe the changes made in Backport > #14416 for 2.5.2 (on both trunk and 2.5.x) over-eagerly > applied mutability to literal strings. In particular, the > strings returned by `inspect` have no real need to be mutable > as far as I can tell. We cannot make assumptions about how people use strings returned from .inspect. Such code exists and we should not break it: warn(foo.inspect << " #{__FILE__}:#{__LINE__}") Disclaimer: I do not speak for the rest of ruby-core. This worked in 2.2 and earlier, and we should be maintaining compatibility with such code. If we have .inspect method returning frozen strings, I consider it a bug. I hate that we allocate extra objects and lose performance; but losing compatibility and breaking existing code is worse. ``` Unsubscribe: