Files
mercury/tests/warnings/infinite_recursion.m
Tyson Dowd 630c98c8f1 Remove support for term_to_type and type_to_term implemented as special
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).
1997-05-20 02:09:15 +00:00

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.