From: "headius (Charles Nutter)" Date: 2012-09-08T04:10:35+09:00 Subject: [ruby-core:47454] [ruby-trunk - Bug #6994] yield plus splat unwraps too much Issue #6994 has been updated by headius (Charles Nutter). Related JRuby bug: http://jira.codehaus.org/browse/JRUBY-6499 ---------------------------------------- Bug #6994: yield plus splat unwraps too much https://bugs.ruby-lang.org/issues/6994#change-29213 Author: headius (Charles Nutter) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: 2.0.0dev and 1.9.3p253 I don't see how anyone could argue that 1.9.3 and 2.0.0 are correct here: system ~/projects/jruby $ ruby-1.8.7-p358 -e "def foo; yield *[1]; end; foo {|a, b, *c| p [a,b,c]}" [1, nil, []] system ~/projects/jruby $ ruby-1.8.7-p358 -e "def foo; yield *[[1]]; end; foo {|a, b, *c| p [a,b,c]}" [[1], nil, []] system ~/projects/jruby $ ruby-1.8.7-p358 -e "def foo; yield *[[[1]]]; end; foo {|a, b, *c| p [a,b,c]}" [[[1]], nil, []] system ~/projects/jruby $ ruby-1.9.3 -e "def foo; yield *[1]; end; foo {|a, b, *c| p [a,b,c]}" [1, nil, []] system ~/projects/jruby $ ruby-1.9.3 -e "def foo; yield *[[1]]; end; foo {|a, b, *c| p [a,b,c]}" [1, nil, []] system ~/projects/jruby $ ruby-1.9.3 -e "def foo; yield *[[[1]]]; end; foo {|a, b, *c| p [a,b,c]}" [[1], nil, []] system ~/projects/jruby $ ruby-2.0.0 -e "def foo; yield *[1]; end; foo {|a, b, *c| p [a,b,c]}" [1, nil, []] system ~/projects/jruby $ ruby-2.0.0 -e "def foo; yield *[[1]]; end; foo {|a, b, *c| p [a,b,c]}" [1, nil, []] system ~/projects/jruby $ ruby-2.0.0 -e "def foo; yield *[[[1]]]; end; foo {|a, b, *c| p [a,b,c]}" [[1], nil, []] system ~/projects/jruby $ ruby-1.9.3 -v ruby 1.9.3p253 (2012-07-04 revision 36307) [x86_64-darwin11.4.0] system ~/projects/jruby $ ruby-2.0.0 -v ruby 2.0.0dev (2012-08-27 trunk 36833) [x86_64-darwin11.4.0] JRuby behaves like 1.8 in both 1.8 and 1.9 modes. I would feel pretty dirty fixing it, since I think the 1.9.3/2.0.0 behavior is wrong. -- http://bugs.ruby-lang.org/