aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-28 02:40:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-28 02:40:46 +0000
commit4191a6b90d3eeb63a31609dba29a1904efee3738 (patch)
tree6689e8d252ca17f1f90626d7ade4b144dbfccdd7 /numeric.c
parent7d49923e9e9a9d1a01f3183fd798258e9d289da0 (diff)
downloadruby-4191a6b90d3eeb63a31609dba29a1904efee3738.tar.gz
preserve encodings in error messages
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/numeric.c b/numeric.c
index 10ed43c870..32c9fcb8e3 100644
--- a/numeric.c
+++ b/numeric.c
@@ -295,7 +295,8 @@ do_coerce(VALUE *x, VALUE *y, int err)
if (!RB_TYPE_P(ary, T_ARRAY) || RARRAY_LEN(ary) != 2) {
if (err) {
rb_raise(rb_eTypeError, "coerce must return [x, y]");
- } else if (!NIL_P(ary)) {
+ }
+ else if (!NIL_P(ary)) {
rb_warn("Bad return value for #coerce, called by numerical comparison operators.");
rb_warn("#coerce must return [x, y]. The next release will raise an error for this.");
}