[前][次][番号順一覧][スレッド一覧]

ruby-changes:37369

From: usa <ko1@a...>
Date: Fri, 30 Jan 2015 18:09:19 +0900 (JST)
Subject: [ruby-changes:37369] usa:r49450 (ruby_2_0_0): * numeric.c (coerce_failed): fixed merge miss of r49443.

usa	2015-01-30 18:09:05 +0900 (Fri, 30 Jan 2015)

  New Revision: 49450

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49450

  Log:
    * numeric.c (coerce_failed): fixed merge miss of r49443.

  Modified files:
    branches/ruby_2_0_0/numeric.c
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/numeric.c
===================================================================
--- ruby_2_0_0/numeric.c	(revision 49449)
+++ ruby_2_0_0/numeric.c	(revision 49450)
@@ -235,9 +235,14 @@ NORETURN(static void coerce_failed(VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/numeric.c#L235
 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
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 49449)
+++ ruby_2_0_0/version.h	(revision 49450)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]