Files
mercury/tests/invalid/arg_permutation.m
Zoltan Somogyi 660cfe4f83 s/predicate symbol predicate/predicate symbol/ in a diagnostic.
We used to generate diagnostics of the form

    The predicate symbol predicate `<'/2 is also overloaded here.

The second "predicate" is pure noise. It could never be "function",
even though the code generating that message was prepared for that.

compiler/typecheck.m:
    When typechecking a *predicate* call, don't specify the predicate
    being called using a data structure that can also refer to functions.

compiler/typecheck_info.m:
    When representing an overloaded predicate name, as opposed to
    an overloaded function name, don't include a pred_or_func indication
    that should *always* be pf_predicate.

compiler/typecheck_errors.m:
    When reporting an overloaded predicate name, or talking about a
    predicate's argument vector, do not take a pred_or_func indication,
    since it should *always* be pf_predicate.

tests/invalid/ambiguous_overloading_error.err_exp:
tests/warnings/ambiguous_overloading.exp:
    Don't expect the redundant "predicate" in the overload error message.

tests/invalid/max_error_line_width.err_exp:
tests/invalid/max_error_line_width.m:
    The deletion of the redundant "predicate" in overload error messages
    made them all fit on one line, robbing this test of its task of testing
    longer-than-80-column output lines. Change the test so that the overload
    is not between int.< and float.<, but between the unchecked_left_shift
    functions in int and uint, since the longer function name yields error
    message lines in the length range this test case wants to test.

tests/invalid/ambiguous_overloading_error.m:
tests/invalid/arg_permutation.m:
tests/invalid/assert_in_interface.m:
tests/invalid/bad_detism_category.m:
    Fix programming style.

tests/invalid/assert_in_interface.err_exp:
    Update a line number.
2020-10-26 20:28:18 +11:00

34 lines
734 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
:- module arg_permutation.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
:- import_module float.
:- import_module int.
:- import_module string.
main(!IO) :-
A = 3.0,
B = 2,
( if test(A, B, 3.0, 4.0, "abc") then
io.write_string("ok\n", !IO)
else
io.write_string("not ok\n", !IO)
).
:- pred test(int::in, float::in, float::in, string::in, float::in) is semidet.
test(A, B, C, D, E) :-
A < 5,
B < 5.0,
C < 5.0,
string.length(D) < 5,
E < 5.0.