Skip to content

Commit 759d128

Browse files
committed
merge revision(s) 49235: [Backport ruby#10711]
numeric.c: fix message * numeric.c (coerce_failed): fix the error message on non-flonum platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@51124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent f81db3c commit 759d128

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

numeric.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,14 @@ NORETURN(static void coerce_failed(VALUE x, VALUE y));
236236
static void
237237
coerce_failed(VALUE x, VALUE y)
238238
{
239+
if (SPECIAL_CONST_P(y) || BUILTIN_TYPE(y) == T_FLOAT) {
240+
y = rb_inspect(y);
241+
}
242+
else {
243+
y = rb_obj_class(y);
244+
}
239245
rb_raise(rb_eTypeError, "%"PRIsVALUE" can't be coerced into %"PRIsVALUE,
240-
(rb_special_const_p(y)? rb_inspect(y) : rb_obj_class(y)),
241-
rb_obj_class(x));
246+
y, rb_obj_class(x));
242247
}
243248

244249
static VALUE

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.1.7"
22
#define RUBY_RELEASE_DATE "2015-07-03"
3-
#define RUBY_PATCHLEVEL 374
3+
#define RUBY_PATCHLEVEL 375
44

55
#define RUBY_RELEASE_YEAR 2015
66
#define RUBY_RELEASE_MONTH 7

0 commit comments

Comments
 (0)