diff --git a/numeric.c b/numeric.c index 3d54a0b688..95d8bc952e 100644 --- a/numeric.c +++ b/numeric.c @@ -235,9 +235,14 @@ NORETURN(static void coerce_failed(VALUE x, VALUE y)); static void coerce_failed(VALUE x, VALUE y) { + if (SPECIAL_CONST_P(y) || BUILTIN_TYPE(y) == T_FLOAT) { + y = rb_inspect(y); + } + else { + y = rb_obj_class(y); + } rb_raise(rb_eTypeError, "%"PRIsVALUE" can't be coerced into %"PRIsVALUE, - (rb_special_const_p(y)? rb_inspect(y) : rb_obj_class(y)), - rb_obj_class(x)); + y, rb_obj_class(x)); } static VALUE diff --git a/version.h b/version.h index 3e8884577c..cfa84bda74 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.0.0" #define RUBY_RELEASE_DATE "2015-01-30" -#define RUBY_PATCHLEVEL 629 +#define RUBY_PATCHLEVEL 630 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 1