Issue #7574 has been reported by tadf (tadayoshi funaba).

----------------------------------------
Bug #7574: 名前についてのエラーメッセージが正しくない事がある
https://bugs.ruby-lang.org/issues/7574

Author: tadf (tadayoshi funaba)
Status: Open
Priority: Low
Assignee: 
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]


名前についてのエラーメッセージが正しくない事がある。

$ ruby -v -e 'instance_variable_get("@foo\000")'
ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]
-e:1:in `instance_variable_get': `@foo' is not allowed as an instance variable name (NameError)

$ ruby -v -e 'Object.class_variable_get("@@foo\000")'
ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]
-e:1:in `class_variable_get': `@@foo' is not allowed as a class variable name (NameError)

$ ruby -v -e 'Object.const_set("FOO\000", 9)'
ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]
-e:1:in `const_set': wrong constant name FOO (NameError)

$ ruby -v -e 'Object.const_get("FOO\000")'
ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]
-e:1:in `const_get': uninitialized constant FOO (NameError)

$ ruby -v -e 'send("foo\000")'
ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]
-e:1:in `<main>': undefined method `foo' for main:Object (NoMethodError)



-- 
http://bugs.ruby-lang.org/