New issue

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

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

Already on GitHub? Sign in to your account

Frozen string literal should be a new object if String#freeze is redefined #2156

headius opened this Issue Nov 8, 2014 · 2 comments


None yet
3 participants

headius commented Nov 8, 2014

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')

I consider this a beginner bug for the interpreter, but a bit more JVM smarts will be required to fix the compiler.

@headius headius added this to the JRuby milestone Nov 8, 2014

@enebo enebo added the JRuby 9000 label Jul 14, 2015

@enebo enebo modified the milestone: JRuby Jul 14, 2015


This comment has been minimized.

hd719 commented Apr 11, 2017

Hello there! I am new to open source and I would like to contribute to this project.


This comment has been minimized.


headius commented Apr 25, 2018

Also affects new String#-@ optimization in 2.5.

headius added a commit that referenced this issue Apr 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment