diff --git a/ChangeLog b/ChangeLog index 1515d32c75..6f4dfb0aa6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Jan 24 16:49:17 2013 Marc-Andre Lafortune + + * enum.c (enum_zip): Fix error message + + * array.c (take_items): Same, for Array#zip + Thu Jan 24 16:47:26 2013 Marc-Andre Lafortune * enumerator.c (lazy_zip): raise error for bad arguments diff --git a/array.c b/array.c index 6f14b99933..f221a614c9 100644 --- a/array.c +++ b/array.c @@ -3047,7 +3047,8 @@ take_items(VALUE obj, long n) result = rb_ary_new2(n); args[0] = result; args[1] = (VALUE)n; if (rb_check_block_call(obj, idEach, 0, 0, take_i, (VALUE)args) == Qundef) - Check_Type(obj, T_ARRAY); + rb_raise(rb_eTypeError, "wrong argument type %s (must respond to :each)", + rb_obj_classname(obj)); return result; } diff --git a/enum.c b/enum.c index 6da937085a..db1609e06c 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