Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: JRuby 1.6.7
-
Fix Version/s: JRuby 2
-
Component/s: Ruby 1.9.3
-
Labels:None
-
Number of attachments :
Description
Found while updating test/rubicon/* for 1.9 mode. 1.9.3 passes this (test_blocks_procs.rb:97):
IS19 = RUBY_VERSION =~ /1\.9/
o = Object.new
def o.f; yield *[[]]; end
o.f {|a,b,*c| puts [a,b,c].inspect}
# 1.9 => [nil, nil, []]
# JRuby --1.9 => [[], nil, []]
A similar case from test/rubicon/test_loop_stuff.rb:254:
class IterTest def initialize(e); @body = e; end def each0(&block); @body.each(&block); end def each1(&block); @body.each { |*x| block.call(*x) } end def each2(&block); @body.each { |*x| block.call(x) } end def each3(&block); @body.each { |x| block.call(*x) } end def each4(&block); @body.each { |x| block.call(x) } end def each5; @body.each { |*x| yield(*x) } end def each6; @body.each { |*x| yield(x) } end def each7; @body.each { |x| yield(*x) } end def each8; @body.each { |x| yield(x) } end end ... IterTest.new([[5]]).each5 { |x2| x = x2 } assert_equal([5], x)