rubinius/rubinius — Issue #1457: Enumerable#inject fails in certain cases in 1.9 mode
Author: tamc
Created: 2011-12-18 22:19:54+00:00
State: open

Hello there

rbx -e "[:a].each_with_index.inject(0) { |a,b| p b; nil }"

correctly prints [:a,0]

RBXOPT=-X19 rbx -e "[:a].each_with_index.inject(0) { |a,b| p b; nil }"

incorrectly prints :a

RBXOPT=-X19 rbx -e "[:a].each_with_index.to_a.inject(0) { |a,b| p b; nil }"

correctly prints [:a,0]

So it looks like something is going wrong when chaining enumerators.

I will have a look to see if I can figure out how to fix this, but it will be my first attempt at Rubinius, so if anyone else feels like taking a look, that would be appreciated.