Bug #2276
Array#<=> should not raise when comparison fails
| Status: | Closed | Start date: | 10/26/2009 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | core | |||
| Target version: | 1.9.2 | |||
| ruby -v: | ruby 1.9.2dev (2009-10-25 trunk 25457) [x86_64-darwin10.0.0] |
Description
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.
Related issues
Associated revisions
* array.c (rb_ary_cmp): Array#<=> returns nil when comparison fails
[ruby-core:26316]