Issue #5689 has been reported by Shyouhei Urabe.

----------------------------------------
Bug #5689: class variables inside of instance methods inside of "class_eval"
http://redmine.ruby-lang.org/issues/5689

Author: Shyouhei Urabe
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2011-11-30 trunk 33904) [x86_64-linux]


????????????????中????????????????????????????????????????????????????????????????????????????以??????????????????????????

zsh % ~/target/trunk/bin/ruby -ve'
class Klass
  @@cvar = "Klass"
end

Klass.module_eval do
  def cvar
    @@cvar
  end
end

@@cvar = "main"
puts Klass.new.cvar'

ruby 2.0.0dev (2011-11-30 trunk 33904) [x86_64-linux]
-e:12: warning: class variable access from toplevel
-e:8: warning: class variable access from toplevel
main



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