Skip to content

Commit 3fc9a23

Browse files
committed
Soften type_check a little in the face of non-6model types. Unbreaks colonpair logic in Rakudo's Actions.pm.
1 parent 2aa210a commit 3fc9a23

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ops/nqp.ops

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,13 @@ inline op type_check(out INT, in PMC, in PMC) :base_core {
392392
PMC *type = decontainerize(interp, $3);
393393
if (val->vtable->base_type == smo_id && type->vtable->base_type == smo_id) {
394394
$1 = STABLE(val)->type_check(interp, val, type);
395-
}
395+
}
396+
else if (type->vtable->base_type == smo_id) {
397+
$1 = 0;
398+
}
396399
else {
397400
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
398-
"Can only use type_check on two SixModelObjects");
401+
"Can only use type_check to check against a SixModelObject");
399402
}
400403
}
401404

0 commit comments

Comments
 (0)