Skip to content

Commit

Permalink
give "this is not a X iterator" more info, too.
Browse files Browse the repository at this point in the history
  • Loading branch information
timo committed Jun 17, 2016
1 parent 4f9013a commit a3264bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/6model/reprs/MVMIter.c
Expand Up @@ -327,7 +327,7 @@ MVMint64 MVM_iter_istrue(MVMThreadContext *tc, MVMIter *iter) {
MVMString * MVM_iterkey_s(MVMThreadContext *tc, MVMIter *iterator) {
if (REPR(iterator)->ID != MVM_REPR_ID_MVMIter
|| iterator->body.mode != MVM_ITER_MODE_HASH)
MVM_exception_throw_adhoc(tc, "This is not a hash iterator");
MVM_exception_throw_adhoc(tc, "This is not a hash iterator, it's a %s (%s)", REPR(iterator)->name, STABLE(iterator)->debug_name);
if (!iterator->body.hash_state.curr)
MVM_exception_throw_adhoc(tc, "You have not advanced to the first item of the hash iterator, or have gone past the end");
return (MVMString *)iterator->body.hash_state.curr->key;
Expand All @@ -338,7 +338,7 @@ MVMObject * MVM_iterval(MVMThreadContext *tc, MVMIter *iterator) {
MVMObject *target;
MVMRegister result;
if (REPR(iterator)->ID != MVM_REPR_ID_MVMIter)
MVM_exception_throw_adhoc(tc, "This is not an iterator");
MVM_exception_throw_adhoc(tc, "This is not an iterator, it's a %s (%s)", REPR(iterator)->name, STABLE(iterator)->debug_name);
if (iterator->body.mode == MVM_ITER_MODE_ARRAY) {
body = &iterator->body;
if (body->array_state.index == -1)
Expand Down

0 comments on commit a3264bf

Please sign in to comment.