mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-29 00:04:55 +00:00
Estimated hours taken: 0.5
Fix an abort reported by Peter Schachte, which was caused by
hlds_module:get_pred_id_and_proc_id attempting to resolve overloading
on a predicate from a `.opt' file, while the code to resolve overloading
in typecheck.m does not attempt to match against predicates declared
in `.opt' files since all calls to such predicates should be module
qualified in the `.opt' file.
compiler/hlds_module.m
If a predicate call is module qualified, there is no overloading
to resolve, so don't check the argument types.
tests/valid/Mmake
tests/valid/intermod_lambda.m
tests/valid/intermod_lambda2.m
Added a regression test.
29 lines
718 B
Mathematica
29 lines
718 B
Mathematica
% Regression test for higher-order terms exported using
|
|
% inter-module optimization.
|
|
:- module intermod_lambda2.
|
|
|
|
:- interface.
|
|
|
|
:- import_module list, set.
|
|
|
|
%-----------------------------------------------------------------------------%
|
|
|
|
:- pred sol(pred(T), list(T)).
|
|
:- mode sol(pred(out) is det, out) is det.
|
|
:- mode sol(pred(out) is det, out) is det.
|
|
|
|
:- implementation.
|
|
|
|
sol(Generator, List) :-
|
|
t(Generator, cons, [], List).
|
|
|
|
:- pred cons(T::in, list(T)::in, list(T)::out) is det.
|
|
cons(H, T, [H|T]).
|
|
|
|
:- pred t(pred(T), pred(T,T2,T2), T2, T2).
|
|
:- mode t(pred(out) is det, pred(in,in,out) is det, in, out) is det.
|
|
|
|
t(_, _, A, A).
|
|
|
|
%-----------------------------------------------------------------------------%
|