[Bug #621] When to call Class#inherited


#1

Bug #621: When to call Class#inherited
http://redmine.ruby-lang.org/issues/show/621

e$B5/I<<Te(B: Shyouhei U.
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
e$BC4Ev<Te(B: Koichi Sasada, e$B%+%F%4%je(B: YARV

1.8e$B$N%P%0$+e(B1.9e$B$N%P%0$+$h$/$o$+$i$s$N$G$9$,!"0J2<$N$h$&$Ke(BClass#inheritede$B$r<B9T$9$k%?%$%_%s%0$,JQ$o$C$F$$$^$9!#e(B

% ruby -ve’
class C
def C.inherited(d)
raise “inherited”
end
end

begin
Class.new C do
raise “new”
end
rescue
p $!
end

ruby 1.9.0 (2008-10-08 revision 17576) [x86_64-linux]
#<RuntimeError: inherited>

% ruby -ve’
class C
def C.inherited(d)
raise “inherited”
end
end

begin
Class.new C do
raise “new”
end
rescue
p $!
end

ruby 1.8.7 (2008-10-08 revision 17572) [x86_64-linux]
#<RuntimeError: new>


#2

e$B%A%1%C%He(B #621 e$B$,99?7$5$l$^$7$?!#e(B (by Kouhei S.)

[ruby-dev:34639]e$B$G$^$D$b$H$5$s$,0U?^E*$KJQ$($?$h$&$JH/8@$r$7$F$$$^$9!#e(B
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-dev/34639

trunke$B$NJ}$,!V$h$$5sF0!W$G$"$k$3$H$O3N$+$G$7$g$&$Me(B(e$B$=$&;W$C$Fe(B
e$BJQ$($?3P$($,$"$ke(B)e$B!#e(B1.8e$B$bB7$($?$$$N$O$d$^$d$^$G$9$,!“8_49@-$Ne(B
e$BLdBj$b$”$k$N$GE,MQ$9$k$+$I$&$+$Oe(Bknue$B$5$s$K$*G$$;$7$^$9!#e(B

e$B$G$b!"J|CV$;$6$k$r$($J$$$+$J!#e(B


http://redmine.ruby-lang.org/issues/show/621


#3

e$B%A%1%C%He(B #621 e$B$,99?7$5$l$^$7$?!#e(B (by Koichi Sasada)

e$B$3$l!$C4Ev$,;d$K$J$C$F$k$s$G$9$,!$$I$&$7$?$b$s$G$7$g$&$+!%e(B

http://redmine.ruby-lang.org/issues/show/621


#4

e$B%A%1%C%He(B #621 e$B$,99?7$5$l$^$7$?!#e(B (by Yui NARUSE)

e$B%+%F%4%je(B coree$B$K%;%C%He(B
e$B%9%F!<%?%9e(B Opene$B$+$ie(BAssignede$B$KJQ99e(B
e$BC4Ev<Te(B Koichi Sasadae$B$+$ie(BAkinori MUSHAe$B$KJQ99e(B
Target version Ruby 1.8.8e$B$K%;%C%He(B

  • e$B$3$NJQ99$Oe(B 1.9 e$B$G$O;EMMJQ99$G$"$ke(B
  • 1.8 e$B$G$NJQ99$Oe(B knu e$B$5$s$,H=CG$9$ke(B

http://redmine.ruby-lang.org/issues/show/621


#5

e$B$I$&$7$?$b$s$G$7$g$&$+!%e(B


#6

e$B%A%1%C%He(B #621 e$B$,99?7$5$l$^$7$?!#e(B (by Akinori MUSHA)

e$B8_49@-$NLdBj$O$"$j$^$9$,!"$3$l$O%P%0$HB*$($?$$5$$,$7$^$9!#e(B
e$B@8@.D>8e$K<B9T$5$l$J$$$N$G$O!"%U%C%/$H$7$F$N5!G=$,TLB;$5$l$^$9$h$M!#e(B

ruby_1_8e$B$G$Oe(Brb_class_initializee$B$r!VD>$9!W$3$H$K$7$^$9!#e(B

http://redmine.ruby-lang.org/issues/show/621


#7

e$B%A%1%C%He(B #621 e$B$,99?7$5$l$^$7$?!#e(B (by Akinori MUSHA)

e$B%9%F!<%?%9e(B Assignede$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

This issue was solved with changeset r25470.
Shyouhei, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


http://redmine.ruby-lang.org/issues/show/621