We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It looks like TruffleRuby isn't fully freezing struct objects. Here's a script to demonstrate expected and actual behavior:
#!/usr/bin/env ruby puts ?=*72 puts "Ruby Engine: #{RUBY_ENGINE} #{RUBY_ENGINE_VERSION}" MyStruct = Struct.new(:a, :b) struct = MyStruct.new(1, 2) puts "Before freeze: %p" % [struct] struct.freeze puts "After freeze: %p" % [struct] begin struct.a = :wat? struct.b = :how! rescue FrozenError => err puts "Modify error: %s" % [err] end puts "After attempt: %p" % [struct] puts "Truly frozen?: %p" % [struct.frozen?] __END__ $ ruby test.rb && RBENV_VERSION=truffleruby-24.2.0 ruby test.rb ======================================================================== Ruby Engine: ruby 3.4.2 Before freeze: #<struct MyStruct a=1, b=2> After freeze: #<struct MyStruct a=1, b=2> Modify error: can't modify frozen MyStruct: #<struct MyStruct a=1, b=2> After attempt: #<struct MyStruct a=1, b=2> Truly frozen?: true ======================================================================== Ruby Engine: truffleruby 24.2.0 Before freeze: #<struct MyStruct a=1, b=2> After freeze: #<struct MyStruct a=1, b=2> After attempt: #<struct MyStruct a=:wat?, b=:how!> Truly frozen?: true
The text was updated successfully, but these errors were encountered:
Thank you for the report, we'll look into it.
Sorry, something went wrong.
andrykonchin
No branches or pull requests
It looks like TruffleRuby isn't fully freezing struct objects. Here's a script to demonstrate expected and actual behavior:
The text was updated successfully, but these errors were encountered: