Issue #5212 has been reported by Mathieu Rousseau.

----------------------------------------
Backport #5212: [*nil] behaves diferently from 1.8.7 to 1.9.3
http://redmine.ruby-lang.org/issues/5212

Author: Mathieu Rousseau
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: Ruby 1.8.7


As to_a is to be obselete, i started to migrate my code and I found a problem. I did not quite know where to fill it in.

$ rvm use 1.8.7
$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]
$ irb          
ruby-1.8.7-p352 :001 > [*nil]
 => [nil] 

$ rvm use 1.9.3
$ ruby -v
ruby 1.9.3dev (2011-07-31 revision 32789) [i686-linux]
$ irb          
ruby-1.9.3-preview1 :001 > [*nil]
 => []

As nil.to_a returns [] and Array(nil) returns [] as well, I deduced that [*nil] in 1.8.7 should return [] as well.

Thanks



-- 
http://redmine.ruby-lang.org