emit callable type errors from call/1 and phrase/3 when appropriate (#2202)
This commit is contained in:
@@ -231,14 +231,17 @@ complete_partial_goal(N, HeadArg, InnerHeadArgs, SuppArgs, CompleteHeadArg) :-
|
||||
integer(N),
|
||||
N >= 0,
|
||||
HeadArg =.. [Functor | InnerHeadArgs],
|
||||
% the next two lines are equivalent to length(SuppArgs, N) but
|
||||
% avoid length/2 so that copy_term/3 (which is invoked by
|
||||
% length/2) can be bootstrapped without self-reference.
|
||||
functor(SuppArgsFunctor, '.', N),
|
||||
SuppArgsFunctor =.. [_ | SuppArgs],
|
||||
% length(SuppArgs, N),
|
||||
append(InnerHeadArgs, SuppArgs, InnerHeadArgs0),
|
||||
CompleteHeadArg =.. [Functor | InnerHeadArgs0].
|
||||
( callable(Functor) ->
|
||||
% the next two lines are equivalent to length(SuppArgs, N) but
|
||||
% avoid length/2 so that copy_term/3 (which is invoked by
|
||||
% length/2) can be bootstrapped without self-reference.
|
||||
functor(SuppArgsFunctor, '.', N),
|
||||
SuppArgsFunctor =.. [_ | SuppArgs],
|
||||
% length(SuppArgs, N),
|
||||
append(InnerHeadArgs, SuppArgs, InnerHeadArgs0),
|
||||
CompleteHeadArg =.. [Functor | InnerHeadArgs0]
|
||||
; type_error(callable, Functor, _)
|
||||
).
|
||||
|
||||
inner_meta_specs(0, HeadArg, InnerHeadArgs, InnerMetaSpecs) :-
|
||||
!,
|
||||
|
||||
Reference in New Issue
Block a user