From: Akira Tanaka Date: 2009-06-26T15:54:39+09:00 Subject: [ruby-core:24043] [Bug #1583] Time + String no Longer Raises TypeError? Issue #1583 has been updated by Akira Tanaka. The problem of rejecting T_STRING is that it cannot reject delegator. For example, Time.now + SimpleDelegator.new("2") should be rejected but the delegator is T_OBJECT, not T_STRING. So we need a method distinguish a object is appropriate for the argument. Unfortunately to_r doesn't work well because String#to_r exists. So we need a more restricted method. nobu's to_rat works well but matz don't accept, due to the name I guess. Note that Time uses to_int and to_r for conversion. So it only needs to_rat. It don't need to_flo and other methods. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1583 ---------------------------------------- http://redmine.ruby-lang.org