Files
mercury/tests/invalid/det_errors_deep.m
Zoltan Somogyi 0888268efb Use color to emphasize some errors.
compiler/add_foreign_proc.m:
compiler/post_typecheck.m:
    As above.

tests/invalid/det_errors_deep.m:
    Fix software rot in this old, never-before-enabled test case.

tests/invalid/Mmakefile:
    Enable the det_errors_deep test case. It seems that the commit
    that added this test case forgot to enable it.

tests/invalid/bad_sv_unify_msg.err_exp:
tests/invalid/bug184.err_exp:
tests/invalid/bug257.err_exp:
tests/invalid/coerce_void.err_exp:
tests/invalid/det_errors_deep.err_exp:
tests/invalid/fp_dup_bug.err_exp:
tests/invalid/fp_dup_bug.err_exp2:
tests/invalid/fp_dup_bug.err_exp3:
tests/invalid/freefree.err_exp:
tests/invalid/typeclass_test_8.err_exp:
tests/invalid/unsatisfiable_constraint.err_exp:
tests/warnings/singleton_test.err_exp:
    Expect updated diagnostics.
2024-05-28 17:58:29 +10:00

40 lines
852 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
:- module det_errors_deep.
:- interface.
:- import_module pair.
:- type t
---> a
; b
; c
; d.
:- type tree
---> leaf
; node(tree, pair(t, int), tree).
:- pred p1(tree::in, t::in, int::out) is det.
:- pred p2(t::in, tree::in, int::out) is det.
:- pred p3(t::in, tree::in, int::out) is det.
:- pred p4(tree::in, t::in, int::out) is det.
:- implementation.
:- import_module int.
p1(leaf, _, 1).
p1(node(_L, X - Y, _R), X, Y).
p2(_, leaf, 1).
p2(X, node(_L, X - Y, _R), Y).
p3(X, node(_L, X - Y, _R), Y).
p4(leaf, _, 1).
p4(node(_L, X - Y, leaf), X, Y).
p4(node(_L, X - Y, node(_RL, X - _, _RR)), X, Y).