diff options
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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)) { |