[Bug:1.8] block.call$B$NCf$G(Bsuper$B$G$-$J$$(B

é ˆè—¤ã§ã™ã€‚

r25975の変更

  • eval.c (proc_invoke): unbound block created by define_method
    cannot call super. [ruby-core:26984]

から、以下のようにすると

NoMethodError: super called outside of method

という例外が発生するようになりました。

class Parent
def run
:parent_run
end
end

class Child < Parent
def run
callback do
super
end
end

def callback(&block)
  block.call
end

end

Child.new.run # -> 例外

Child#callbackの中のblock.callをyieldにすると例外は起きなく
なります。

SubjectにBugをつけてしまったのですが、そもそもこれはBugではな
く意図した変更なのでしょうか?

とりあえず、テストケースは添付しておきます。

余談ですが、この間リリースされたRuby 1.8.7にもこの変更が入っ
ていたため、Rabbitが動かなくなり、この違いに気づきました。

e$B$H$_$?$G$9!#e(B

On Tue, 12 Jan 2010 23:00:47 +0900
Kouhei S. [email protected] wrote:

r25975e$B$NJQ99e(B

  • eval.c (proc_invoke): unbound block created by define_method
    cannot call super. [ruby-core:26984]

e$B$+$i!"0J2<$N$h$&$K$9$k$He(B

NoMethodError: super called outside of method

e$B$H$$$&Nc30$,H/@8$9$k$h$&$K$J$j$^$7$?!#e(B

http://redmine.ruby-lang.org/issues/show/2537 e$B$G$9$M!#e(B

e$B?\F#$G$9!#e(B

In [email protected]
“[ruby-dev:40062] Re: [Bug:1.8]
block.calle$B$NCf$Ge(Bsupere$B$G$-$J$$e(B” on Wed, 13 Jan 2010 01:21:05
+0900,
e$B$H$_$?$^$5$R$me(B [email protected] wrote:

http://redmine.ruby-lang.org/issues/show/2537 e$B$G$9$M!#e(B

e$B=EJ#$7$F$?$s$G$9$M!#$9$_$^$;$s!#!#!#e(B

"nobu will fix this soon.“e$B$H$”$k$s$G%P%0G’Dj$H$$$&$3$H$G$9$he(B
e$B$M!#%F%9%H%1!<%9$O%3%_%C%H$7$F$b$h$$$G$9$+!)e(B

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

ruby -v 1.8e$B$K%;%C%He(B

e$B<[email protected]$,$"$j!"BT$C$?$,$+$+$C$F$$$k$h$&$G$9e(B

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

e$B?\F#$G$9!#e(B

In [email protected]
“[ruby-dev:40069] [Bug #2600]
block.calle$B$NCf$Ge(Bsupere$B$G$-$J$$e(B” on Wed, 13 Jan 2010 21:34:21
+0900,
Yui NARUSE [email protected] wrote:

ruby -v 1.8e$B$K%;%C%He(B

e$B<[email protected]$,$"$j!"BT$C$?$,$+$+$C$F$$$k$h$&$G$9e(B

[email protected]$1$G$9$+!)e(Bruby_1_8_7e$B$b$G$9$+!)e(B

e$B?\F#$G$9!#e(B

block.calle$B$NCf$Ge(Bsupere$B$,$G$-$J$$LdBje(B

e$B$K$D$$$F$G$9!#e(B

e$B<[email protected]$,$"$j!"BT$C$?$,$+$+$C$F$$$k$h$&$G$9e(B

e$B$H$$$&[email protected]$=$&$G$9$,!"$I$N$h$&[email protected]$,$"$C$F!":#$O$I$&$$$&e(B
e$B>uBV$J$N$+CN$C$F$$$k?M$O$$$^$;$s$+!)$"$k$$$O!"C/$KJ9$1$P$$$$e(B
e$B$+CN$C$F$$$k?M$O$$$^$;$s$+!)e(B

e$BKNIt$G$9!#e(B

Kouhei S. e$B$5$s$O=q$-$^$7$?e(B:

e$B$H$$$&[email protected]$=$&$G$9$,!"$I$N$h$&[email protected]$,$"$C$F!":#$O$I$&$$$&e(B
e$B>uBV$J$N$+CN$C$F$$$k?M$O$$$^$;$s$+!)$"$k$$$O!"C/$KJ9$1$P$$$$e(B
e$B$+CN$C$F$$$k?M$O$$$^$;$s$+!)e(B

e$B%M%,%F%#%V$JH?1~$7$+$G$-$J$/$F?=$7Lu$J$$!";[email protected]!W$K$D$$$FGD0.$7$F$*$ie(B
e$B$:!"$7$?$,$C$F$I$N$h$&$K$b%"%/%7%g%s$,$H$l$J$$46$8$G$9!#e(B

[email protected]@%$5$s$,[email protected]$m$&$+e(B

e$B0U?^[email protected]=PMh<!Bh$G%P%C%/%]!<%H$O9T$&M=Dj$G$$$^$9!#$4ITJX$re(B
e$B$*$+$1$7$F?=$7Lu$J$$$G$9!#e(B

e$B?\F#$G$9!#e(B

In [email protected]
“[ruby-dev:40245] Bug #2600
block.calle$B$NCf$Ge(Bsupere$B$G$-$J$$e(B” on Sat, 30 Jan 2010 01:39:15
+0900,
Yui NARUSE [email protected] wrote:

http://redmine.ruby-lang.org/issues/show/2600
e$B$3$l$O!"!V2?$KBP$7$FD99M$7$F$$$k!W$+$b65$($F$b$i$($J$$!"$"$ke(B
e$B$$$O65$($k$N$,BgJQ$H$$$&$3$H$G$7$g$&$+!)e(B

e$BNc$($P!"!V5sF0$OK>$^$7$/$J$$$N$GD>$9!"$1$I!“D>$7J}$rD99M$7$Fe(B
[email protected]$H!“e(B1.8.7e$B$+$i$Oe(Breverte$B$9$k$3$H$b$G$-$k$+$b$7$l$^$;$s$7!“e(B
e$B!V5sF0$OK>$^$7$$$1$I!”!{!{$rD99M$7$F$$$k!W$G$”$l$P!”%"%W%j%1!<e(B
e$B%7%g%sB&$G8=:_$N5sF0$K$"$o$;$k$3$H$,$G$-$k$+$b$7$l$^$;$s!#e(B

e$B$b$72DG=$G$"$l$P!“7h$^$C$F$$$k$H$3$m$^$G$G$$$$$N$G65$($F$b$ie(B
e$B$($^$;$s$+!)$”$k$$$O!"$3$3$O7h$^$C$F$$$J$$$H$$$&$H$3$m$G$b=ue(B
e$B$+$j$^$9!#e(B

e$BKNIt$G$9!#e(B

Kouhei S. e$B$5$s$O=q$-$^$7$?e(B:

e$B$b$72DG=$G$"$l$P!“7h$^$C$F$$$k$H$3$m$^$G$G$$$$$N$G65$($F$b$ie(B
e$B$($^$;$s$+!)$”$k$$$O!"$3$3$O7h$^$C$F$$$J$$$H$$$&$H$3$m$G$b=ue(B
e$B$+$j$^$9!#e(B

e$B:#F|!"[email protected]$5$s$K2q$C$?$N$G3NG’$7$F$-$^$7$?!#!V$=$l$O$A$g$C$HA0$KD>$7$?!W$i$7e(B
e$B$$$G$9!#:#3NG[email protected]$H!“e(B svn diff -r26534:26536
e$B$”$?$j$,3:Ev$NJQ99$N$h$&$Ke(B
e$B8+$^$9!#$"$C$F$^$9$+e(B?

e$B%A%1%C%He(B #2600 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 Nobuyoshi N.e$B$K%;%C%He(B
e$BM%@hEYe(B Lowe$B$+$ie(BNormale$B$KJQ99e(B
Target version Ruby 1.8.8e$B$K%;%C%He(B

e$BCfED$5$sC4Ev$G$"$k$,!"8=:_:Y$+$$ItJ,$GD99MCf$H$$$&%9%F!<%?%9$G$9!#e(B

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

e$B?\F#$G$9!#e(B

In [email protected]
“[ruby-dev:40301] Re: Bug #2600
block.calle$B$NCf$Ge(Bsupere$B$G$-$J$$e(B” on Wed, 3 Feb 2010 14:37:15
+0900,
Urabe S. [email protected] wrote:

e$B$b$72DG=$G$"$l$P!“7h$^$C$F$$$k$H$3$m$^$G$G$$$$$N$G65$($F$b$ie(B
e$B$($^$;$s$+!)$”$k$$$O!"$3$3$O7h$^$C$F$$$J$$$H$$$&$H$3$m$G$b=ue(B
e$B$+$j$^$9!#e(B

e$B:#F|!"[email protected]$5$s$K2q$C$?$N$G3NG’$7$F$-$^$7$?!#!V$=$l$O$A$g$C$HA0$KD>$7$?!W$i$7e(B
e$B$$$G$9!#:#3NG[email protected]$H!“e(B svn diff -r26534:26536 e$B$”$?$j$,3:Ev$NJQ99$N$h$&$Ke(B
e$B8+$^$9!#$"$C$F$^$9$+e(B?

e$B$"$j$,$H$&$4$6$$$^$9!#e(B
e$B$3$Ne(Bdiffe$B$N%F%9%H$,%Q%9$9$k$N$G$"$l$PBg>[email protected]$H;W$$$^$9!#e(B

1.8.7e$B$K$b%P%C%/%]!<%H$7$F$b$i$($k$H$&$l$7$$$G$9!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs