Hi Jacob,

I cannot reporduse.

>ruby -v inherited.rb
ruby 1.9.2dev (2010-07-06 revision 28549) [i386-mswin32_90]
A was inherited by B
Definition of B
A was inherited by #<Class:0xb523e0>
Definition of #<Class:0xb523e0>

Please paste the result of  ruby -v.

2010/7/6 Jacob Lauem=F8ller <jacob.lauemoeller / iteray.com>:
> Hi all,
>
> Please consider this example:
>
>
> class A
> =A0def self.inherited(subclass)
> =A0 =A0puts "A was inherited by #{subclass}"
> =A0end
> end
>
> class B < A
> =A0puts "Definition of #{self}"
> end
>
> C =3D Class.new(A) do
> =A0puts "Definition of #{self}"
> end
>
>
> When run, the output is
>
> A was inherited by B
> Definition of B
> Definition of #<Class:0x100124e80>
> A was inherited by #<Class:0x100124e80>
>
> So, the inherited callback was called *before* the class body in the "sta=
tic" subclass B, but *after* the code in the block passed to Class.new for =
the dynamic subclass C. Is this a bug?
>
> My question is: why is this so? Shouldn't the two ways of creating subcla=
sses be equivalent?
>
> Kind regards
> Jacob
>