Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make interpolated strings frozen #2304

Merged
merged 1 commit into from
Mar 25, 2021

Conversation

kirs
Copy link
Contributor

@kirs kirs commented Mar 24, 2021

This PR attempts to solve #2303 by making strings that were built using interpolation frozen.

# frozen_string_literal: true
p "foo #{14}".frozen?

Before this patch, the line above printed false. With this patch it prints true. We think this better aligns with Ruby 2.7 behaviour, given that's the one that TruffleRuby aims to target: truffleruby 21.1.0-dev-90afa7e8, like ruby 2.7.2.

@eregon
Copy link
Member

eregon commented Mar 24, 2021

Looks good, and avoiding to change the semantics in the core library should limit the risk of this change.
Please adapt the specs as suggested, other than that it's ready to merge.

@eregon eregon linked an issue Mar 24, 2021 that may be closed by this pull request
@oracle oracle deleted a comment from quasialaw Mar 25, 2021
@kirs kirs force-pushed the frozen-interpolation branch from 8a0e7b4 to d3f8d50 Compare March 25, 2021 11:53
@kirs kirs requested a review from eregon March 25, 2021 11:56
Copy link
Member

@eregon eregon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@eregon eregon added the in-ci The PR is being tested in CI. Do not push new commits. label Mar 25, 2021
@eregon eregon added this to the 21.2.0 milestone Mar 25, 2021
graalvmbot pushed a commit that referenced this pull request Mar 25, 2021
@graalvmbot graalvmbot merged commit 1dc3608 into oracle:master Mar 25, 2021
@chrisseaton chrisseaton deleted the frozen-interpolation branch March 26, 2021 21:20
@eregon eregon mentioned this pull request Oct 7, 2021
82 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-ci The PR is being tested in CI. Do not push new commits. oca-signed shopify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interpolated string literals aren't frozen
5 participants