Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.7
-
Fix Version/s: JRuby 1.7.0.RC1
-
Component/s: Core Classes/Modules, Ruby 1.9.3
-
Labels:None
-
Environment:mac osx
-
Number of attachments :
Description
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
Issue Links
- is duplicated by
-
JRUBY-6687
Array#pretty_inspect is wrong for multidimensional arrays in ruby-1.9 emulation mode
-
Confirmed on master as of today.