[BUG:trunk] Array#push with no argument on a frozen array


#1

Yuguie$B$G$9e(B

Freezee$B$5$l$?G[Ns$+$ie(B0e$B8De(Bpope$B$7$h$&$H$9$k$He(BArgumentErrore$B$,H/@8$7$^$9!#e(B
(1.8.7e$B$G$Oe(BTypeError)

[1, 2].freeze.pop(0) #=> ArgumentError

e$B0lJ}e(BFreezee$B$5$l$?G[Ns$Ke(B0e$B8De(Bpushe$B$7$h$&$H$9$k$H2?$b5/$-$^$;$s!#e(B

[1, 2].freeze.push()

e$B$3$l$O0U?^$5$l$?$3$H$G$7$g$&$+e(B?


#2

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:37440] [BUG:trunk] Array#push with no argument
on a frozen array”
on Mon, 15 Dec 2008 10:56:58 +0900, “Yugui (Yuki S.)”
removed_email_address@domain.invalid writes:

|Freezee$B$5$l$?G[Ns$+$ie(B0e$B8De(Bpope$B$7$h$&$H$9$k$He(BArgumentErrore$B$,H/@8$7$^$9!#e(B
|(1.8.7e$B$G$Oe(BTypeError)

e$B$(!"e(BRuntimeErrore$B$G$O$J$/$F!)e(B
1.9e$B$G$Oe(Bfreezee$B$5$l$?%*%V%8%’%/%He(B
e$B$NA`:n$Ge(BTypeErrore$B$G$O$J$/e(BRuntimeErrore$B$,=P$^$9!#$3$l$Oe(B1.9e$B$G$Ne(B
e$B;EMMJQ99!#e(B

|[1, 2].freeze.pop(0) #=> ArgumentError
|
|e$B0lJ}e(BFreezee$B$5$l$?G[Ns$Ke(B0e$B8De(Bpushe$B$7$h$&$H$9$k$H2?$b5/$-$^$;$s!#e(B
|
|[1, 2].freeze.push()
|
|e$B$3$l$O0U?^$5$l$?$3$H$G$7$g$&$+e(B?

e$BC1$K%(%i!<%A%’%C%/$N=gHV$NLdBj$G$9$M$(!#e(Bpope$B$G$Oe(Bfreezee$B%A%’%Ce(B
e$B%/e(B(rb_ary_modify)e$B$,@h$KMh$F$$$k$N$G%(%i!<$K$J$j!“e(Bpushe$B$G$O0ze(B
e$B?t$N?t$N%A%’%C%/$,@h$J$N$G%(%i!<$K$J$kA0$Ke(Bnope$B$G$”$k$3$H$rH=e(B
e$BJL$G$-$F$$$k$o$1$G$9!#e(B

e$B6-3&%1!<%9$@$H;W$&$N$G$I$C$A$G$bNI$$$H;W$&$N$G$9$,!"B7$($?J}e(B
e$B$,8m2r$O>/$J$$$G$7$g$&$M!#$I$C$A$,NI$$$H;W$$$^$9!)e(B

                            e$B$^$D$b$He(B e$B$f$-$R$me(B /:|)

#3

e$B%A%1%C%He(B #878 e$B$,99?7$5$l$^$7$?!#e(B (by Yukihiro M.)

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

Applied in changeset r20840.

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