Issue #3080 has been updated by Koichi Sasada.

Target version changed from 1.9.3 to 1.9.x

Let's discuss after 1.9.3.  Sorry.

----------------------------------------
Bug #3080: class_variable_set issue with duped Module
http://redmine.ruby-lang.org/issues/3080

Author: Evgeniy Dolzhenko
Status: Assigned
Priority: Normal
Assignee: Koichi Sasada
Category: 
Target version: 1.9.x
ruby -v: ruby 1.9.2dev (2010-04-02 trunk 27162) [i686-linux]


=begin
 Below is the test case which is failing for me on ruby 1.9.2dev (2010-04-02 trunk 27162) [i686-linux] but works on ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-linux]:
 
 ---
 module Original
   @@cvar = nil
 
   def self.module_get_cvar
     @@cvar
   end
 
   def function_get_cvar
     @@cvar
   end
 end
 
 Duped = Original.dup
 
 Original.send(:class_variable_set, :@@cvar, "cvar in Original")
 Duped.send(:class_variable_set, :@@cvar, "cvar in Duped")
 
 class IncludesOriginal
   include Original
 end
 
 class IncludesDuped
   include Duped
 end
 
 puts IncludesOriginal.new.function_get_cvar # => cvar in Original
 puts IncludesDuped.new.function_get_cvar # => cvar in Duped
 
 puts Original.module_get_cvar # => cvar in Original
 
 puts Duped.module_get_cvar # => 19_duped_module_class_variable_set_bug.rb:3: warning: class variable access from toplevel
                            #    19_duped_module_class_variable_set_bug.rb:3:in `get_cvar': uninitialized class variable @@cvar in Object (NameError)
                            #            from 19_duped_module_class_variable_set_bug.rb:13:in `<main>'
 ---
=end



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