summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-24 07:51:05 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-24 07:51:05 +0000
commit96af5360a4089daf90743ad4722e77eff2261145 (patch)
tree1947bc517fbe570b95016009602ad3c3192f24d5 /enum.c
parentaab2f788d784ef73dd088f7cc6e258672da0ae59 (diff)
* enum.c (enum_zip): Fix error message
* array.c (take_items): Same, for Array#zip [Bug #7706] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/enum.c b/enum.c
index 6da9370..db1609e 100644
--- a/enum.c
+++ b/enum.c
@@ -2051,7 +2051,10 @@ enum_zip(int argc, VALUE *argv, VALUE obj)
if (!allary) {
CONST_ID(conv, "to_enum");
for (i=0; i<argc; i++) {
- if (!rb_respond_to(argv[i], id_each)) Check_Type(argv[i], T_ARRAY);
+ if (!rb_respond_to(argv[i], id_each)) {
+ rb_raise(rb_eTypeError, "wrong argument type %s (must respond to :each)",
+ rb_obj_classname(argv[i]));
+ }
argv[i] = rb_funcall(argv[i], conv, 1, ID2SYM(id_each));
}
}