Issue #5748 has been updated by Yukihiro Matsumoto.


??????ャ?<?潟??????????????с?????class_eval??????違?罅帛刈??莊??紊??????障????????
----------------------------------------
Bug #5748: class_eval ?????????????с?????違??鴻?潟?若???????????ャ?<?潟?????????
http://redmine.ruby-lang.org/issues/5748

Author: Yasunori Miyamoto
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 1.9.3
ruby -v: ruby 1.9.3p0 (2011-10-30) [i386-mingw32]


篁ヤ????? class_eval ??茯????????????
http://doc.ruby-lang.org/ja/1.9.3/method/Module/i/class_eval.html
> 絎???違????劫????違??鴻?潟?若????????荳???≪?吾?ャ?若???臂?????????????鴻?潟?若?????????障?????
????????с????????篁ヤ?????潟?若?????絎?茵?????????? NameError ?????榊???????障?????

class MyClass
    CONST = "MyClass"
end

MyClass.class_eval do
    p CONST        # => NameError
end


絎?茵?腟????:
test.rb:6:in `block in <main>': uninitialized constant CONST (NameError)
        from test.rb:5:in `class_eval'
        from test.rb:5:in `<main>'

???緇???????腟????:
"MyClass" ??茵腓冴???????????


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