Project

General

Profile

Bug #2047

Time#<=> Raises NoMethodError on Incomparable Argument

Added by runpaint (Run Paint Run Run) over 10 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
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

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

Updated by yugui (Yuki Sonoda) over 10 years ago

  • Status changed from Open to Assigned
  • Assignee set to matz (Yukihiro Matsumoto)
  • Target version set to 1.9.2

=begin

=end

#2

Updated by marcandre (Marc-Andre Lafortune) over 10 years ago

  • Status changed from Assigned to Closed

=begin

=end

Also available in: Atom PDF