Yielding a single object to a block with |a, b| arguments does not call #to_ary
-------------------------------------------------------------------------------
Key: JRUBY-6125
URL: https://jira.codehaus.org/browse/JRUBY-6125
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.7
Reporter: Martin Harriman
Assignee: Thomas E Enebo
Assume that s is a method that yields a single object:
{noformat}
def s(a)
yield(a)
end
def somethingelse
s(obj) {|a, b| [a, b]}
end
{format}
When somethingelse executes, MRI will call obj.toAry, and if toAry returns
[:thing, :otherthing], a gets :thing and b gets :otherthing. In jruby, a gets
obj, and b gets nil, and obj.toAry is not called.
This is tested in rubyspec/language/block_spec.rb
--
This message is automatically generated by JIRA.
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