From: noreply@... Date: 2007-01-26T08:05:47+09:00 Subject: [ ruby-Bugs-8156 ] class variables and inheritance Bugs item #8156, was opened at 2007-01-25 15:05 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1698&aid=8156&group_id=426 Category: Core Group: 1.8.4 Status: Open Resolution: None Priority: 3 Submitted By: Lance Ivy (cainlevy) Assigned to: Nobody (None) Summary: class variables and inheritance Initial Comment: The unexpected behavior is shown in this script: --------------- #!/usr/bin/ruby class A def self.foo @@foo end def self.foo=(val) @@foo = val end end class B < A; end class C < A; end A.foo = 'a' B.foo = 'b' C.foo = 'c' puts A.foo puts B.foo puts C.foo --------------- When I run this, I expect to see: a b c But instead I see: c c c ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1698&aid=8156&group_id=426