Skip to content

Symbol#to_s returns a frozen String #7481

@postmodern

Description

@postmodern

Symbol#to_s returns a frozen String on JRuby 9.4, but under CRuby 3.1 it returns a new unfrozen String.

sym = :foo
str = sym.to_s
str.frozen?

Environment Information

  • jruby 9.4.0.0 (3.1.0) 2022-11-23 95c0ec159f OpenJDK 64-Bit Server VM 17.0.5+8 on 17.0.5+8 +jit [x86_64-linux]

Expected Behavior

# => false

Actual Behavior

# => true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions