mark term_variables type errors with blame

This commit is contained in:
Mark Thom
2018-10-03 23:08:25 -06:00
parent 8e4bb039f0
commit d9b5734688

View File

@@ -206,11 +206,15 @@ get_args([Arg|Args], Func, I0, N) :-
'$call_with_default_policy'(get_args(Args, Func, I1, N)).
% term_variables.
can_be(Type, Term) :- error:can_be(Type, Term).
term_variables(Term, Vars) :-
error:can_be(list, Vars),
catch(can_be(list, Vars), error(E, Ctx),
( ( var(Ctx) -> Ctx = term_variables/2 ; true ),
throw(error(E, Ctx)) ) ),
'$term_variables'(Term, Vars).
% setup_call_cleanup.
setup_call_cleanup(S, G, C) :- '$get_b_value'(B),