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:
parent
b948b1a4e1
commit
40e7aefeba
Notes:
git
2021-12-28 18:35:22 +09:00
4 changed files with 20 additions and 26 deletions
4
bignum.c
4
bignum.c
|
@ -7169,10 +7169,6 @@ rb_int_powm(int const argc, VALUE * const argv, VALUE const num)
|
|||
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);
|
||||
|
||||
#ifdef USE_GMP
|
||||
|
|
|
@ -6290,10 +6290,6 @@ Init_Numeric(void)
|
|||
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_undef_alloc_func(rb_cFloat);
|
||||
|
|
|
@ -54,8 +54,8 @@ while 0x00012345 >= $counter
|
|||
srand +big && $counter >> 0b1
|
||||
|
||||
Enumerable
|
||||
Fixnum
|
||||
Bignum
|
||||
String
|
||||
Struct
|
||||
Math
|
||||
Complex
|
||||
Comparable
|
||||
|
|
|
@ -1,25 +1,27 @@
|
|||
require_relative '../../spec_helper'
|
||||
|
||||
describe "Fixnum" do
|
||||
it "is unified into Integer" do
|
||||
suppress_warning do
|
||||
Fixnum.should equal(Integer)
|
||||
ruby_version_is ""..."3.1" do
|
||||
describe "Fixnum" do
|
||||
it "is unified into Integer" do
|
||||
suppress_warning do
|
||||
Fixnum.should equal(Integer)
|
||||
end
|
||||
end
|
||||
|
||||
it "is deprecated" do
|
||||
-> { Fixnum }.should complain(/constant ::Fixnum is deprecated/)
|
||||
end
|
||||
end
|
||||
|
||||
it "is deprecated" do
|
||||
-> { Fixnum }.should complain(/constant ::Fixnum is deprecated/)
|
||||
end
|
||||
end
|
||||
describe "Bignum" do
|
||||
it "is unified into Integer" do
|
||||
suppress_warning do
|
||||
Bignum.should equal(Integer)
|
||||
end
|
||||
end
|
||||
|
||||
describe "Bignum" do
|
||||
it "is unified into Integer" do
|
||||
suppress_warning do
|
||||
Bignum.should equal(Integer)
|
||||
it "is deprecated" do
|
||||
-> { Bignum }.should complain(/constant ::Bignum is deprecated/)
|
||||
end
|
||||
end
|
||||
|
||||
it "is deprecated" do
|
||||
-> { Bignum }.should complain(/constant ::Bignum is deprecated/)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue