summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/numeric.c b/numeric.c
index f5b0fc24fe..ea90e03588 100644
--- a/numeric.c
+++ b/numeric.c
@@ -52,6 +52,8 @@ coerce_rescue(x)
VALUE *x;
{
TypeError("%s can't be coerced into %s",
+ rb_special_const_p(x[1])?
+ STR2CSTR(rb_inspect(x[1])):
rb_class2name(CLASS_OF(x[1])),
rb_class2name(CLASS_OF(x[0])));
}
@@ -643,6 +645,10 @@ num2int(val)
TypeError("no implicit conversion from string");
return Qnil; /* not reached */
+ case T_NIL:
+ TypeError("no implicit conversion from nil");
+ return Qnil; /* not reached */
+
default:
val = rb_rescue(to_integer, val, fail_to_integer, val);
if (!obj_is_kind_of(val, cInteger)) {