Interpolated strings are no longer frozen with frozen-string-literal: true - #3488
Conversation
| assert_predicate(s3, :frozen?) | ||
| assert_predicate(s4, :frozen?) | ||
| assert_not_predicate(s3, :frozen?) | ||
| assert_predicate(s4, :frozen?) # should probably not be frozen, but unrealistic code |
There was a problem hiding this comment.
I couldn't find what optimizes s = "#{'foo'}" to just putobject "foo".
Ideally it should not be frozen.
OTOH, I believe nobody write such code (but rather "#{s}").
There was a problem hiding this comment.
@nobu has a fix for this: https://bugs.ruby-lang.org/issues/17104#note-20
I'm not sure if it's worth the added complexity.
24042ed to
7666cbe
Compare
jeremyevans
left a comment
There was a problem hiding this comment.
Looks good to me, but @ko1 should probably review the compile.c parts as my experience there is more limited.
… true * Remove freezestring instruction since this was the only usage for it. * [Feature ruby#17104]
7666cbe to
24bf9ed
Compare
|
I was waiting for more reviews but they did not happen in 2 weeks. |
freezestringinstruction since this was the only usage for it.