Project

General

Profile

Actions

Bug #9966

closed

Encoding.find(symbol)の動作がrdocと異なる

Added by kimuraw (Wataru Kimura) almost 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.0dev (2014-06-20 trunk 46480) [x86_64-darwin13]
[ruby-dev:48308]

Description

http://www.ruby-doc.org/core-2.1.2/Encoding.html#method-c-find

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となります。

Updated by sorah (Sorah Fukumori) almost 8 years ago

コミットを追ってみましたが最初から rdoc が間違ってたんじゃないか説が…
どうなんでしょう?

Updated by nobu (Nobuyoshi Nakada) almost 8 years ago

  • Category set to doc

Symbolを想定してたことはないですね。

Updated by nobu (Nobuyoshi Nakada) almost 8 years ago

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

Applied in changeset r46481.


encoding.c: fix rdoc [ci skip]

Updated by nagachika (Tomoyuki Chikanaga) over 7 years ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE

Backported into ruby_2_1 branch at r47216.

Updated by nagachika (Tomoyuki Chikanaga) over 7 years ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: DONE to 2.0.0: DONE, 2.1: DONE

And already backported into ruby_2_0_0 branch at r46670.

Actions

Also available in: Atom PDF