[#48582] Fwd: [ruby-changes:35635] nobu:r47717 (trunk): ruby.h: deprecate plain Data — SASADA Koichi <ko1@...>
ちょっといきなりこれは無いんじゃ無いでしょうか。
3 messages
2014/09/27
[#48586] Re: [ruby-cvs:54890] nobu:r47742 (trunk): common.mk: update only non-existing files — "Martin J. Dürst" <duerst@...>
gitweb =E3=81=8C Last-Modified =E3=82=92=E9=80=81=E4=BF=A1=E3=81=97=E3=81=
4 messages
2014/09/30
[#48589] Re: [ruby-cvs:54890] nobu:r47742 (trunk): common.mk: update only non-existing files
— Nobuyoshi Nakada <nobu@...>
2014/10/01
On 2014/09/30 15:18, "Martin J. Dürst" wrote:
[ruby-dev:48580] [ruby-trunk - Bug #10276] nil/true/false に singleton メソッドを定義できてしまう
From:
zn@...
Date:
2014-09-27 08:34:48 UTC
List:
ruby-dev #48580
Issue #10276 has been updated by Kazuhiro NISHIYAMA.
frozen =E3=81=AA=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88=E3=
=81=AB=E7=89=B9=E7=95=B0=E3=82=AF=E3=83=A9=E3=82=B9=E3=81=8C=E4=BD=9C=E6=88=
=90=E3=81=A7=E3=81=8D=E3=82=8B=E3=81=8B=E3=81=A9=E3=81=86=E3=81=8B=E3=82=82=
=E7=B5=B1=E4=B8=80=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84=E3=
=82=88=E3=81=86=E3=81=A7=E3=81=99=E3=81=8C=E3=80=81=E3=81=9D=E3=81=86=E3=81=
=84=E3=81=86=E3=82=82=E3=81=AE=E3=81=AA=E3=81=AE=E3=81=A7=E3=81=97=E3=82=87=
=E3=81=86=E3=81=8B?
~~~
>> RUBY_DESCRIPTION
=3D> "ruby 2.2.0dev (2014-09-25 trunk 47711) [x86_64-linux]"
>> class << :sym; end
TypeError: can't define singleton
from (irb):2
from /home/kazu/.rbenv/versions/git/bin/irb:11:in `<main>'
>> class << 1; end
TypeError: can't define singleton
from (irb):3
from /home/kazu/.rbenv/versions/git/bin/irb:11:in `<main>'
>> class << nil; end
=3D> nil
>> class << Object.new.freeze; end
=3D> nil
>>
~~~
----------------------------------------
Bug #10276: nil/true/false =E3=81=AB singleton =E3=83=A1=E3=82=BD=E3=83=83=
=E3=83=89=E3=82=92=E5=AE=9A=E7=BE=A9=E3=81=A7=E3=81=8D=E3=81=A6=E3=81=97=E3=
=81=BE=E3=81=86
https://bugs.ruby-lang.org/issues/10276#change-49113
* Author: Kazuhiro NISHIYAMA
* Status: Open
* Priority: Normal
* Assignee:=20
* Category: core
* Target version: current: 2.2.0
* ruby -v: ruby 2.2.0dev (2014-09-21 trunk 47672) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
nil/true/false =E3=81=8C frozen object =E3=81=AA=E3=81=AE=E3=81=AB singleto=
n =E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E3=82=92=E5=AE=9A=E7=BE=A9=E3=81=A7=
=E3=81=8D=E3=81=A6=E3=81=97=E3=81=BE=E3=81=84=E3=81=BE=E3=81=99=E3=80=82
~~~
% cat /tmp/f.rb
def d(o)
p o.frozen?
def o.m; end
rescue
p [o, $!]
end
d(:sym)
d(1)
d(nil)
d(true)
d(false)
d(Object.new.freeze)
% ruby -v /tmp/f.rb
ruby 2.2.0dev (2014-09-21 trunk 47672) [x86_64-linux]
true
[:sym, #<TypeError: can't define singleton>]
true
[1, #<TypeError: can't define singleton>]
true
true
true
true
[#<Object:0x00000002706730>, #<RuntimeError: can't modify frozen object>]
~~~
--=20
https://bugs.ruby-lang.org/