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
The call to Enumerator#with_index is supposed to return a new Enumerator if no block is given, but should return an array if a block is given.
Additionally, the output of [:a].map.with_index { |value, idx| [value, idx] }.to_a is the original array, not the mapped version.
The text was updated successfully, but these errors were encountered:
This appears to be working, so this bug is probably specific for with_index and not a generic bug. I've used this one as a mitigation for the issue in #2145, I have to admit this one is a bit more readable as well.
Observed in #2145 where it broke our self hosted compiler. This snippet:
The output of MRI (I used version 3.3.3, but it should be the same in any supported version):
The output of the same program ran with Natalie:
The call to
Enumerator#with_index
is supposed to return a new Enumerator if no block is given, but should return an array if a block is given.Additionally, the output of
[:a].map.with_index { |value, idx| [value, idx] }.to_a
is the original array, not the mapped version.The text was updated successfully, but these errors were encountered: