Project

General

Profile

Backport #4196

Array#flatten!(0) should return nil

Added by djberg96 (Daniel Berger) almost 9 years ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
[ruby-core:33841]

Description

=begin
Since Array#flatten!(0) does not modify the array I believe it should return nil. At the moment, in 1.8.7-p302, it returns itself.

irb(main):001:0> [1,[2,3,[4,5]]].flatten!(0)
=> [1, [2, 3, [4, 5]]]

Note that JRuby 1.5.6 returns nil for the above code, so either MRI is wrong or JRuby is wrong.
=end

History

#1

Updated by hasari (Hiro Asari) almost 9 years ago

=begin
To wit, 1.9 returns nil as well.

$ irb1.9
irb(main):001:0> RUBY_DESCRIPTION
=> "ruby 1.9.3dev (2010-12-18 trunk 30244) [x86_64-darwin10.5.0]"
irb(main):002:0> [1,[2,3,[4,5]]].flatten!(0)
=> nil

=end

#2

Updated by jeremyevans0 (Jeremy Evans) 4 months ago

  • ruby -v deleted (ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin10.4.0])
  • Target version deleted (Ruby 1.8.7)
  • Status changed from Open to Closed
  • Description updated (diff)
  • Project changed from Ruby 1.8 to Backport187
  • Tracker changed from Bug to Backport

Also available in: Atom PDF