From: "usa (Usaku NAKAMURA)" <usa@...>
Date: 2012-12-21T22:23:03+09:00
Subject: [ruby-dev:46794] [ruby-trunk - Bug #7574][Assigned] 名前についてのエラーメッセージが正しくない事がある


Issue #7574 has been updated by usa (Usaku NAKAMURA).

Status changed from Open to Assigned


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

Author: tadf (tadayoshi funaba)
Status: Assigned
Priority: Low
Assignee: nobu (Nobuyoshi Nakada)
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/