Project

General

Profile

Bug #2276

Array#<=> should not raise when comparison fails

Added by marcandre (Marc-Andre Lafortune) almost 10 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
ruby -v:
ruby 1.9.2dev (2009-10-25 trunk 25457) [x86_64-darwin10.0.0]
Backport:
[ruby-core:26316]

Description

=begin
Since the addition of Object#<=>, the only comparison that raised an error was Array#<=>(not_an_array).

Array#<=>(obj) now returns nil if obj is not array-like.

Maybe this should also be applied in the 1.8 line?

Note: neither test-all nor rubyspec were testing for this.
=end


Related issues

Related to Ruby master - Feature #1697: Object#<=>Closed06/28/2009Actions

Also available in: Atom PDF