Project

General

Profile

Actions

Bug #2276

closed

Array#<=> should not raise when comparison fails

Added by marcandre (Marc-Andre Lafortune) about 15 years ago. Updated over 13 years ago.

Status:
Closed
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 1 (0 open1 closed)

Related to Ruby master - Feature #1697: Object#<=>Closedmatz (Yukihiro Matsumoto)06/28/2009Actions

No data to display

Actions

Also available in: Atom PDF

Like0