Subject: String#rindex(other) doesn't try to convert other via to_str
From: Florian Gross <florgro gmail.com>
Date: Mon, 16 Jul 2007 00:27:37 +0900
Hi,
in both 1.8.6 (2007-03-13) and 1.9.0 (2007-06-30):
obj = Object.new
def obj.to_str() "y" end
"ruby".index(obj) # => 3
"ruby".rindex(obj) # ~> in `rindex': type mismatch: Object given
(TypeError)
Kind regards,
Florian Gross