Project

General

Profile

Bug #14549

Updated by nobu (Nobuyoshi Nakada) about 6 years ago

~~~ruby ~~~ 
 require 'date' 
 o = Object.new 
 def o.<=>(*) 
   2 
 end 
 Date.new(2000, 1, 1).step(3, o) { } 
 #=> abort 
 ~~~ 

 I think, It's not intentional behavior. 
 And it should raise `TypeError` TypeError or `ArgumentError`, ArgumentError, maybe.

Back