rubinius/rubinius — pull request #1459 by tamc (2011-12-19 22:53:45+00:00)
Title: Changed Enumerable#inject, Enumerator#each_with_index and Enumerator#with_index to use Rubinius.single_block_arg, which should fix #1457

In 1.9 mode, if each_with_index was followed by inject or by each_with_index again, it gave a different answer from MRI 1.9 and from 1.8 in MRI and Rubinius. Reported as issue #1457.

To fix this, I changed Enumerable#inject, Enumerator#each_with_index and Enumerator#with_index to use:

o = Rubinius.single_block_arg

I hope that was the right thing to do. It seems to fix the problem without causing any other spec failures.

I wasn't quite clear how to structure the specs.

Advice appreciated.

Thanks

Tom