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
Struct.new(:x).new.hash on TruffleRuby always creates the same hash, while on MRI/JRuby it creates a different hash for different struct classes.
Struct.new(:x).new.hash
@eregon: Actually Struct.new(:y).new.hash also has the same hash, the hash is only based on Struct values currently, which seems suboptimal.
The text was updated successfully, but these errors were encountered:
Thanks for the report.
I think we should use something like val = Primitive.vm_hash_start(Truffle::Type.object_class(self).hash) in
val = Primitive.vm_hash_start(Truffle::Type.object_class(self).hash)
truffleruby/src/main/ruby/truffleruby/core/struct.rb
Line 309 in 0dc999f
Line 440 in 0dc999f
It seems a good idea to add a ruby/spec that Struct.new(:x).new(1).hash != Struct.new(:y).new(1).hash.
Struct.new(:x).new(1).hash != Struct.new(:y).new(1).hash
Sorry, something went wrong.
Fixed in d9235b8 by @bjfish, thanks for the report.
bjfish
No branches or pull requests
Struct.new(:x).new.hash
on TruffleRuby always creates the same hash, while on MRI/JRuby it creates a different hash for different struct classes.The text was updated successfully, but these errors were encountered: