From cbf4eca61e1b051593b5d29c657546260247e785 Mon Sep 17 00:00:00 2001 From: hsbt Date: Fri, 21 Mar 2014 00:45:52 +0000 Subject: * complax.c: [DOC] Document number conversion of `nil` by @skade [fix GH-570] [ci skip] * object.c, rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- object.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'object.c') diff --git a/object.c b/object.c index e3e6a7de1a..7dc5407630 100644 --- a/object.c +++ b/object.c @@ -2746,13 +2746,15 @@ rb_Integer(VALUE val) * In any case, strings should be strictly conformed to numeric * representation. This behavior is different from that of * String#to_i. Non string values will be converted using - * to_int, and to_i. + * to_int, and to_i. Passing nil + * raises a TypeError. * * Integer(123.999) #=> 123 * Integer("0x1a") #=> 26 * Integer(Time.new) #=> 1204973019 * Integer("0930", 10) #=> 930 * Integer("111", 2) #=> 7 + * Integer(nil) #=> TypeError */ static VALUE -- cgit v1.2.3