Project

General

Profile

Actions

Bug #7574

closed

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

Added by tadf (tadayoshi funaba) about 12 years ago. Updated almost 12 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.0.0dev (2012-12-16 trunk 38415) [i686-linux]
Backport:
[ruby-dev:46749]

Description

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

$ 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)

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0