Project

General

Profile

Actions

Bug #601

closed

an instance of Bignum can have singleton methods

Added by yugui (Yuki Sonoda) over 15 years ago. Updated almost 13 years ago.

Status:
Closed
ruby -v:
Backport:
[ruby-dev:36569]

Description

=begin
Bignumのインスタンスが特異メソッドを持てるようです。

$ ruby19 -e 'x = (1 << 64); begin; def x.foo; p 1; end; rescue; end; x.foo'
#=> 1
(by mameさん)

現在の「Fixnumに対する一貫性 + どうせ誰も使わない」という設計意図からすれば特異クラスを作ろうとする時点でTypeErrorになるべきではないでしょうか。
=end


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #3222: Can bignums have singleton class & methods?Closedko1 (Koichi Sasada)04/30/2010Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0