Closed djberg96 closed 1 year ago
truffleruby 22.3.0, like ruby 3.0.3, GraalVM CE Native [x86_64-darwin]
As per the title, MRI raises an IndexError if the value provided to the values_at method is out of bounds. Currently TruffleRuby returns [nil].
values_at
[nil]
Struct.new('ValuesAt', :a, :b, :c, :d, :e, :f) struct = Struct::ValuesAt.new(1, 2, 3, 4, 5) p struct.values_at(99) # => Should raise "offset 99 too large for struct(size:6) (IndexError)"
Thanks for the report, this should be fairly easy to fix in https://github.com/oracle/truffleruby/blob/master/src/main/ruby/truffleruby/core/struct.rb
Fixed in 7adb9cb54d00867272aa1e50a5ec32507695cd52
truffleruby 22.3.0, like ruby 3.0.3, GraalVM CE Native [x86_64-darwin]
As per the title, MRI raises an IndexError if the value provided to the
values_at
method is out of bounds. Currently TruffleRuby returns[nil]
.