Make Array.new to accept both integers and floats.

This time we used `Integral` module which is mruby specific.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2018-08-13 15:07:10 +09:00
parent 11d5782687
commit fee9ec61bb
+1 -1
View File
@@ -66,7 +66,7 @@ class Array
#
# ISO 15.2.12.5.15
def initialize(size=0, obj=nil, &block)
raise TypeError, "expected Integer for 1st argument" unless size.kind_of? Integer
raise TypeError, "expected Integer for 1st argument" unless size.kind_of? Integral
raise ArgumentError, "negative array size" if size < 0
self.clear