1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Remove obsolete Fixnum and Bignum

This commit is contained in:
Nobuyoshi Nakada 2020-12-28 11:58:21 +09:00
parent b948b1a4e1
commit 40e7aefeba
Notes: git 2021-12-28 18:35:22 +09:00
4 changed files with 20 additions and 26 deletions

View file

@ -7169,10 +7169,6 @@ rb_int_powm(int const argc, VALUE * const argv, VALUE const num)
void void
Init_Bignum(void) Init_Bignum(void)
{ {
/* An obsolete class, use Integer */
rb_define_const(rb_cObject, "Bignum", rb_cInteger);
rb_deprecate_constant(rb_cObject, "Bignum");
rb_define_method(rb_cInteger, "coerce", rb_int_coerce, 1); rb_define_method(rb_cInteger, "coerce", rb_int_coerce, 1);
#ifdef USE_GMP #ifdef USE_GMP

View file

@ -6290,10 +6290,6 @@ Init_Numeric(void)
rb_gc_register_mark_object(rb_fix_to_s_static[i]); rb_gc_register_mark_object(rb_fix_to_s_static[i]);
} }
/* An obsolete class, use Integer */
rb_define_const(rb_cObject, "Fixnum", rb_cInteger);
rb_deprecate_constant(rb_cObject, "Fixnum");
rb_cFloat = rb_define_class("Float", rb_cNumeric); rb_cFloat = rb_define_class("Float", rb_cNumeric);
rb_undef_alloc_func(rb_cFloat); rb_undef_alloc_func(rb_cFloat);

View file

@ -54,8 +54,8 @@ while 0x00012345 >= $counter
srand +big && $counter >> 0b1 srand +big && $counter >> 0b1
Enumerable Enumerable
Fixnum String
Bignum Struct
Math Math
Complex Complex
Comparable Comparable

View file

@ -1,6 +1,7 @@
require_relative '../../spec_helper' require_relative '../../spec_helper'
describe "Fixnum" do ruby_version_is ""..."3.1" do
describe "Fixnum" do
it "is unified into Integer" do it "is unified into Integer" do
suppress_warning do suppress_warning do
Fixnum.should equal(Integer) Fixnum.should equal(Integer)
@ -10,9 +11,9 @@ describe "Fixnum" do
it "is deprecated" do it "is deprecated" do
-> { Fixnum }.should complain(/constant ::Fixnum is deprecated/) -> { Fixnum }.should complain(/constant ::Fixnum is deprecated/)
end end
end end
describe "Bignum" do describe "Bignum" do
it "is unified into Integer" do it "is unified into Integer" do
suppress_warning do suppress_warning do
Bignum.should equal(Integer) Bignum.should equal(Integer)
@ -22,4 +23,5 @@ describe "Bignum" do
it "is deprecated" do it "is deprecated" do
-> { Bignum }.should complain(/constant ::Bignum is deprecated/) -> { Bignum }.should complain(/constant ::Bignum is deprecated/)
end end
end
end end