Closed djberg96 closed 1 year ago
truffleruby 22.3.0, like ruby 3.0.3, GraalVM CE Native [x86_64-darwin]
The MatchData#values_at method appears to be dropping nil when a range is larger than the number of matched values:
matchdata = /\w+/.match('hello') p matchdata.values_at(0, 1) # => ["hello", nil] # ok p matchdata.values_at(0..1) # => ["hello"] # oops, expected ["hello", nil]
Thank you for reporting!
The issue can be reproduced easily. Will work on a fix.
Fixed in 2596a2316f73e5e938dfb0d1f7e6ad6cbb31e3d1
truffleruby 22.3.0, like ruby 3.0.3, GraalVM CE Native [x86_64-darwin]
The MatchData#values_at method appears to be dropping nil when a range is larger than the number of matched values: