From: sto.mar@... Date: 2017-04-09T18:15:05+00:00 Subject: [ruby-dev:50066] [Ruby trunk Misc#12835][Closed] RDoc comment of String#casecmp Issue #12835 has been updated by stomar (Marcus Stollsteimer). Status changed from Open to Closed Closing since the rdoc matches the actual behavior. Additionally I opened a new issue because raising TypeError seems to be inconsistent with other comparison methods, see #13312. ---------------------------------------- Misc #12835: RDoc comment of String#casecmp https://bugs.ruby-lang.org/issues/12835#change-64134 * Author: dogatana (Toshihiko Ichida) * Status: Closed * Priority: Normal * Assignee: ---------------------------------------- String#casecmp dose not return nil but raise TypError for incomparable argument. So ~~~ * str.casecmp(other_str) -> -1, 0, +1 or nil ~~~ should be like ~~~ * str.casecmp(other_str) -> -1, 0, +1 ~~~ or ~~~ * str.casecmp(other_str) -> -1, 0, +1 or raise TypeError if other_str is not comparable ~~~ Here is a example. ~~~ irb(main):001:0> "a" <=> 1 => nil irb(main):002:0> "a".casecmp(1) TypeError: no implicit conversion of Fixnum into String ~~~ Japanese Reference Manual has same issue. -- https://bugs.ruby-lang.org/