
Issue #20966 has been updated by getajobmike (Mike Perham). Subject changed from Unary to Unary plus String warns about freezing My code: ``` header = +"\x1f\x8b".force_encoding("BINARY") ``` Rubocop says "Use unary plus to get an unfrozen string literal." But Ruby 3.4rc1 says: ``` profiling_test.rb:49: warning: literal string will be frozen in the future (run with --debug-frozen-string-literal for more information) ``` Should `+"string"` issue a warning like that? ---------------------------------------- Bug #20966: Unary plus String warns about freezing https://bugs.ruby-lang.org/issues/20966#change-111070 * Author: getajobmike (Mike Perham) * Status: Open * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- /Users/mperham/src/sidekiq/test/profiling_test.rb:49: warning: literal string will be frozen in the future (run with --debug-frozen-string-literal for more information) -- https://bugs.ruby-lang.org/