Actions
Bug #12128
closedStrings in `ARGV` are frozen
Description
It is not clear how the frozen status of strings in ARGV
are to be described, but regardless of what I try to do (i.e. set frozen string pragma as false, which is probably irrelevant because the strings are already created at the time of file load), the strings appear frozen. I ran the following file foo.rb
as ruby foo.rb bar
:
#!/usr/bin/env ruby
# frozen_string_literal: false
ARGV.first.frozen? #=> true
ARGV.first.upcase! #=> can't modify frozen String (RuntimeError)
I believe this is a bug. If not, I would like to know what determines the frozen status of the strings in ARGV
. Is it a feature that they are always frozen?
Actions
Like0
Like0Like0Like0Like0