< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
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