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

ruby-changes:37154

From: nobu <ko1@a...>
Date: Tue, 13 Jan 2015 21:07:26 +0900 (JST)
Subject: [ruby-changes:37154] nobu:r49235 (trunk): numeric.c: fix message

nobu	2015-01-13 21:07:14 +0900 (Tue, 13 Jan 2015)

  New Revision: 49235

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

  Log:
    numeric.c: fix message
    
    * numeric.c (coerce_failed): fix the error message on non-flonum
      platforms.

  Modified files:
    trunk/numeric.c
Index: numeric.c
===================================================================
--- numeric.c	(revision 49234)
+++ numeric.c	(revision 49235)
@@ -237,9 +237,14 @@ NORETURN(static void coerce_failed(VALUE https://github.com/ruby/ruby/blob/trunk/numeric.c#L237
 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

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

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