mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-20 16:31:04 +00:00
Estimated hours taken: 5 Remove support for term_to_type and type_to_term implemented as special preds. Remove support for one-cell and one-or-two-cell type_infos (now shared-one-or-two-cell type_infos). Move definitions that were in mercury_builtin.m back to where they belong. This code has been removed because it is no longer used, and was no longer being maintained but was still quite complex. tests/general/disj_disj.m: tests/general/dnf.m: tests/general/higher_order.m: tests/general/nondet_disj.m: tests/hard_coded/cc_nondet_disj.m: tests/hard_coded/pragma_inline.m: tests/invalid/funcs_as_preds.err_exp: tests/misc_tests/mdemangle_test.exp: tests/valid/agc_unbound_typevars.m: tests/valid/middle_rec_labels.m: tests/valid/subtype_switch.m: tests/warnings/infinite_recursion.m: Import module `list' or `term' (or both).
35 lines
589 B
Mathematica
35 lines
589 B
Mathematica
% Test the warning for infinite recursion.
|
|
:- module infinite_recursion.
|
|
:- interface.
|
|
:- import_module io.
|
|
|
|
:- pred main(io__state::di, io__state::uo) is det.
|
|
|
|
:- implementation.
|
|
:- import_module std_util, list.
|
|
|
|
main -->
|
|
( { funny_append([1,2,3], [4,5,6], [5,6,7]) } ->
|
|
main
|
|
;
|
|
{ loop }
|
|
).
|
|
|
|
:- pred loop is det.
|
|
|
|
loop :-
|
|
( semidet_succeed ->
|
|
loop
|
|
;
|
|
true
|
|
).
|
|
|
|
:- pred funny_append(list(T), list(T), list(T)).
|
|
:- mode funny_append(in, in, out) is det.
|
|
|
|
funny_append(L1, L2, L3) :-
|
|
L1 = [], L2 = L3
|
|
;
|
|
L1 = [X|_Xs], L3 = [X|Zs],
|
|
funny_append(L1, L2, Zs). % L1 should be _Xs.
|