You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Need specs for each_with_index + Enumerable method interaction #1283
There are at least three cases from jruby/jruby#8345 where an interaction between an each_with_index Enumerator and an Enumerable method was or is broken in JRuby:
to_h
uniq
zip
Of these, we've fixed uniq and I have a fix in process for to_h but I'm not sure where to put specs for this kind of interaction.
My first thought was in Enumerable specs, since that's where I had to fix things, but I have not come up with a reproduction that doesn't use an each_with_index enumerator. All cases should be specified, though only a few exhibited this differing behavior between CRuby and JRuby.
Running the same example script against TruffleRuby shows similar issues, so I think getting these cases spec'ed would benefit all impls:
Wrong first link I think?
I think it might be worth to discuss on https://bugs.ruby-lang.org/, though presumably the behavior of CRuby is already relied on and cannot really be changed, so it's also fine to spec the current behavior in parallel.
PR(s) welcome.
Activity
Pass multi-elt array key for to_h using yieldArray
eregon commentedon Aug 20, 2025
Wrong first link I think?
I think it might be worth to discuss on https://bugs.ruby-lang.org/, though presumably the behavior of CRuby is already relied on and cannot really be changed, so it's also fine to spec the current behavior in parallel.
PR(s) welcome.