Forum: Ruby-dev [ruby-trunk - Bug #9966] [Closed] Encoding.find(symbol)の動作がrdocと異なる

F1d6cc2b735bfd82c8773172da2aeab9?d=identicon&s=25 Nobuyoshi Nakada (nobu)
on 2014-06-21 00:10
(Received via mailing list)
Issue #9966 has been updated by Nobuyoshi Nakada.

Status changed from Open to Closed
% Done changed from 0 to 100

Applied in changeset r46481.

----------
encoding.c: fix rdoc [ci skip]

* encoding.c (enc_find): [DOC] never accepted a symbol.
  [ruby-dev:48308] [Bug #9966]

----------------------------------------
Bug #9966: Encoding.find(symbol)の動作がrdocと異なる
https://bugs.ruby-lang.org/issues/9966#change-47312

* Author: Wataru Kimura
* Status: Closed
* Priority: Normal
* Assignee:
* Category: doc
* Target version:
* ruby -v: ruby 2.2.0dev (2014-06-20 trunk 46480) [x86_64-darwin13]
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED
----------------------------------------
http://www.ruby-doc.org/core-2.1.2/Encoding.html#m...

Encding.find()は、stringまたはsymbolを受け付けるとrdocにありますが、
symbolを渡したときはTypeErrorになります。これは意図された動作でしょうか?

~~~
% /usr/local/stow/ruby-2.2-dev/bin/ruby -e 'Encoding.find(:Shift_JIS)'
-e:1:in `find': no implicit conversion of Symbol into String (TypeError)
  from -e:1:in `<main>'
~~~

ruby-2.1.2とruby-2.0.0p481でも同様にTypeErrorとなります。
This topic is locked and can not be replied to.