Files
mercury/tests/valid/intermod_lambda2.m
Julien Fischer 5d8b328d45 Fix a test that no longer compiles due to a type
Estimated hours taken: 0.1
Branches: main

tests/valid/intermod_lambda2.m:
	Fix a test that no longer compiles due to a type
	ambiguity caused by the inclusion of list.cons/3
	in the library.
2004-03-20 04:58:06 +00:00

38 lines
1.0 KiB
Mathematica

% Regression test for higher-order terms exported using
% inter-module optimization.
% This is also a regression test to check that local modes are put
% in the .opt files.
:- module intermod_lambda2.
:- interface.
:- import_module list.
%-----------------------------------------------------------------------------%
:- pred sol(pred(T), list(T)).
:- mode sol(pred(out) is det, out) is det.
:- implementation.
:- mode in2 :: in.
sol(Generator, List) :-
Test = ((pred) is semidet),
TestFunc = ((func) = 1),
Cons = lambda([Elem::in, L0::in, L::out] is det, (
intermod_lambda2__cons(Elem, L0, L)
)),
t(Test, TestFunc, Generator, Cons, [], List).
:- pred intermod_lambda2__cons(T::in, list(T)::in, list(T)::out) is det.
intermod_lambda2__cons(H, T, [H|T]).
:- pred t((pred), ((func) = int), pred(T), pred(T,T2,T2), T2, T2).
:- mode t((pred) is semidet, ((func) = out is det),
pred(out) is det, pred(in,in,out) is det, in2, out) is det.
t(_, _, _, _, A, A).
%-----------------------------------------------------------------------------%