HashMap#map does not splat the arguments to the block
-----------------------------------------------------

                 Key: JRUBY-5820
                 URL: http://jira.codehaus.org/browse/JRUBY-5820
             Project: JRuby
          Issue Type: Bug
          Components: Java Integration
    Affects Versions: JRuby 1.6.2
         Environment: 
jruby 1.6.2 (ruby-1.9.2-p136) (2011-05-23 e2ea975) (Java HotSpot(TM) Client VM 
1.6.0_24) [darwin-i386-java]
            Reporter: Theo Hultberg


{noformat}
require 'java'

import java.util.HashMap

h = HashMap.new
h['x'] = 3
h['y'] = 4
p h.map { |pair| pair }   # => [['x', 3], ['y', 4]]
p h.map { |k, v| [k, v] } # => [['x', nil], ['y', nil]]
{noformat}

The output from the last two lines should be the same, but they aren't. In the 
last line {{v}} is always nil. #each works as expected, splatting the arguments 
correctly as far as I can tell.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to