Skip to content
New issue

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

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

Already on GitHub? # to your account

warning: literal string will be frozen in the future in ruby 3.4.0-preview2 #136

Open
tmimura39 opened this issue Oct 15, 2024 · 4 comments · May be fixed by #137
Open

warning: literal string will be frozen in the future in ruby 3.4.0-preview2 #136

tmimura39 opened this issue Oct 15, 2024 · 4 comments · May be fixed by #137

Comments

@tmimura39
Copy link

tmimura39 commented Oct 15, 2024

Warning by https://bugs.ruby-lang.org/issues/20205

# bundle exec rake minitest
Run options: --seed 23847

# Running:

/ruby-http-client/lib/ruby_http_client.rb:143: warning: literal string will be frozen in the future
...../ruby-http-client/lib/ruby_http_client.rb:143: warning: literal string will be frozen in the future
./ruby-http-client/lib/ruby_http_client.rb:156: warning: literal string will be frozen in the future
./ruby-http-client/lib/ruby_http_client.rb:143: warning: literal string will be frozen in the future
.../ruby-http-client/lib/ruby_http_client.rb:143: warning: literal string will be frozen in the future
.../ruby-http-client/lib/ruby_http_client.rb:143: warning: literal string will be frozen in the future
../ruby-http-client/lib/ruby_http_client.rb:143: warning: literal string will be frozen in the future
.../ruby-http-client/lib/ruby_http_client.rb:143: warning: literal string will be frozen in the future
/ruby-http-client/lib/ruby_http_client.rb:143: warning: literal string will be frozen in the future
/ruby-http-client/lib/ruby_http_client.rb:143: warning: literal string will be frozen in the future
....../ruby-http-client/lib/ruby_http_client.rb:143: warning: literal string will be frozen in the future
.../ruby-http-client/lib/ruby_http_client.rb:143: warning: literal string will be frozen in the future
.../ruby-http-client/lib/ruby_http_client.rb:143: warning: literal string will be frozen in the future
.F./ruby-http-client/lib/ruby_http_client.rb:143: warning: literal string will be frozen in the future
./ruby-http-client/lib/ruby_http_client.rb:143: warning: literal string will be frozen in the future

The choices are these

  • Use ''.dup or String.new('') or +''.
  • Magic comment frozen_string_literal: false like Shopify/httpclient.
  • Ignore warnings until Ruby v3.4 policy is finalized.
  • and other...
@chaadow chaadow linked a pull request Nov 17, 2024 that will close this issue
8 tasks
@chaadow
Copy link

chaadow commented Nov 17, 2024

Hi @tmimura39 I made a PR that hopefully should resolve the issue

@tmimura39
Copy link
Author

Thanks.
Yes, I agree. I think that will resolve this issue 😄

@qarol
Copy link

qarol commented Jan 10, 2025

Any update on that? Ruby 3.4 is publicly available now.

@chaadow
Copy link

chaadow commented Feb 22, 2025

please could you look at my PR @pmcanseco thanks

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants