Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.7.0.pre1
-
Fix Version/s: JRuby 1.7.0.pre2
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
Assume that s is a method that yields a single object:
def s(a)
yield(a)
end
def somethingelse
s(obj) {|a, b| [a, b]}
end
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
Appears to work fine as of 1.7pre2.