[BUG] a class can not access class variable of the module it extends
Reported by Le Huy | February 3rd, 2008 @ 04:26 AM | in 1.0 preview
huy@huy-desktop:/u01/rubinius/code$ ./shotgun/rubinius
irb(main):001:0> module Foo; @@a=true; def m; @@a; end; end
=> #<CompiledMethod:0x401b9 name=m file=(irb)>
irb(main):004:0> self.extend(Foo).m
=> true
irb(main):002:0> class Bar; end
=> Bar
irb(main):003:0> Bar.extend(Foo).m
NameError: uninitialized class variable @@a in Bar
from Module(Class)#class_variable_get at kernel/core/module.rb:95
from MethodContext#class_variable_get at kernel/core/context.rb:159
from #<IncludedModule:0x401d1>(Class)#m at (irb):1
from Object#irb_binding {} at (irb):3
irb(main):005:0>
Comments and changes to this ticket
-

farleyknight February 3rd, 2008 @ 11:14 AM
I believe I just submitted a patch for this.. Sorry I didn't look first!
-
Eero Saynatkari February 3rd, 2008 @ 08:11 PM
- → State changed from new to invalid
Closing as a duplicate, #306 remains open. Thanks for reporting!
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
