Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.2
-
Fix Version/s: JRuby 1.6.3, JRuby 1.7.0.pre1
-
Component/s: Ruby 1.9.2
-
Labels:None
-
Environment:jruby 1.6.2 (ruby-1.9.2-p136) (2011-05-23 e2ea975) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_25) [linux-amd64-java]
-
Testcase included:yes
-
Number of attachments :
Description
When calling each_with_index followed by map, the block passed to map gets only the value and not the index. See this gist:
https://gist.github.com/1032299
The above test works fine in JRuby 1.6.2 in 1.8 mode, and in MRI 1.9.2. It fails in JRuby 1.9.2 using 1.9 mode.
Issue Links
- is related to
-
JRUBY-5839
Enumerable#map is picky about it's internal block arguments in --1.9 mode
-
Seeing the same problem but I'm pretty sure this is very closely related to http://jira.codehaus.org/browse/JRUBY-5839. In my case yielding values as an array fixed map. I suspect each_with_index is running into a similar issue.