Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Frozen string literal should be a new object if String#freeze is redefined #2156
I added "foo".freeze support recently, but I did not put in a check if String#freeze has been overridden. That leads to a failure in this test from ruby/test_optimization.rb:
def test_string_freeze assert_equal "foo", "foo".freeze assert_redefine_method('String', 'freeze', 'assert_nil "foo".freeze') end
I consider this a beginner bug for the interpreter, but a bit more JVM smarts will be required to fix the compiler.