Skip to content

Conversation

@trinistr
Copy link
Contributor

@trinistr trinistr commented Nov 11, 2025

From #1265.

String literals in files without a frozen_string_literal comment now emit a deprecation warning
when they are mutated.
These warnings can be enabled with -W:deprecated or by setting Warning[:deprecated] = true.
To disable this change, you can run Ruby with the --disable-frozen-string-literal
command line argument. [Feature #20205]

  • String#+@ now duplicates when mutating the string would emit
    a deprecation warning, offered as a replacement for the
    str.dup if str.frozen? pattern.

Maybe this needs to be squashed? But they are separate things 🤷

@trinistr trinistr marked this pull request as ready for review November 11, 2025 21:36
@trinistr trinistr force-pushed the 3.4-mutating-string-literals branch from af08d92 to 80c7135 Compare November 11, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant