From: Adam Prescott Date: 2011-08-27T06:49:33+09:00 Subject: [ruby-core:39129] Re: [Ruby 1.9 - Bug #5235][Open] Ruby fails to freeze Strings and Numerics. --00151747619c32dce504ab6f85da Content-Type: text/plain; charset=UTF-8 This is not a bug. `x += 1` is sugar for `x = x + 1`, and x + 1 does not modify the receiver. Similar for `s += "a"`. s = "" s.freeze s.replace("nothing") #=> RuntimeError: can't modify frozen string --00151747619c32dce504ab6f85da Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This is not a bug. `x +=3D 1` is sugar for `x =3D x + 1`, and x + 1 does no= t modify the receiver. Similar for `s +=3D "a"`.

s =3D ""
s.freeze
s.replace("nothing&= quot;) #=3D>=C2=A0RuntimeError: can't modify frozen string
--00151747619c32dce504ab6f85da--