Project

General

Profile

Actions

Backport #5212

closed

[*nil] behaves diferently from 1.8.7 to 1.9.3

Added by mathieu (Mathieu Rousseau) over 12 years ago. Updated almost 5 years ago.

Status:
Closed
Assignee:
-
[ruby-core:<unknown>]

Description

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

Actions #1

Updated by jeremyevans0 (Jeremy Evans) almost 5 years ago

  • Project changed from Ruby 1.8 to Backport187
  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0