Project

General

Profile

Actions

Bug #2047

closed

Time#<=> Raises NoMethodError on Incomparable Argument

Added by runpaint (Run Paint Run Run) about 15 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.2dev (2009-09-03 trunk 24741) [i686-linux]
Backport:
[ruby-core:25365]

Description

=begin
$ cat /tmp/time-spaceship.rb
p Time.now <=> Object.new

$ ruby8 -v /tmp/time-spaceship.rb
ruby 1.8.8dev (2009-09-04) [i686-linux]
nil

$ ruby -v /tmp/time-spaceship.rb
ruby 1.9.2dev (2009-09-03 trunk 24741) [i686-linux]
/tmp/time-spaceship.rb:1:in <=>': undefined method <=>' for #Object:0x8d3a77c (NoMethodError)
from /tmp/time-spaceship.rb:1:in `'

This is a specific example of the wider issue marcandre eloquently explained in http://redmine.ruby-lang.org/issues/show/1697 .
=end


Related issues 1 (0 open1 closed)

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

Also available in: Atom PDF

Like0
Like0Like0