Gabriel Horner created JRUBY-6550:
-------------------------------------

             Summary: [1.9] yield yields incorrect args when splatted args 
passed as 2nd arg to yield
                 Key: JRUBY-6550
                 URL: https://jira.codehaus.org/browse/JRUBY-6550
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules, Ruby 1.9.3
    Affects Versions: JRuby 1.6.7
         Environment: mac osx
            Reporter: Gabriel Horner


Executing the following:

def passes(*args, &block); yield([1,2,3]); end
def fails(*args, &block); yield([1,2,3], *args); end

passes {|x| p x }
passes(4) {|x| p x }
fails {|x| p x }
fails(4) {|x| p x }

In 1.9.3 and rubinius 1.9, all yields print -> [1,2,3]

In jruby 1.6.7 and 1.7.0 dev (in 1.9 mode), I get:
[1, 2, 3]
[1, 2, 3]
1
[1, 2, 3]

As you can see, yield([1,2,3], *args) yields the first argument split up 
instead of yielding the full array. I noticed this bug while trying to get my 
test suite jruby 1.9 compatible on bacon: 
https://github.com/chneukirchen/bacon/blob/master/lib/bacon.rb#L346

This ticket may be related: http://jira.codehaus.org/browse/JRUBY-6499

Thanks

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.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