Files
mercury/tests/invalid/ho_default_func_3.err_exp
Zoltan Somogyi 50c3301737 Simplify some code in error_util.m.
compiler/error_util.m:
    Interpret each context just once per error_msg, not once per line.

    Add the fixed indent after the context, creating a prefix string,
    just once per error_msg, not once per line.

    Compute the length of the prefix directly from the prefix string,
    instead of counting the characters that go into its components.

    Don't print out the line-specific indent on blank lines.

    Replace a quadratic algorithm with a linear one.

    For each line we output, record the total length of its words,
    and the total length available for those words. This prepares
    for a future change that will try to replace several lines, even if
    they ended with "nl" pieces, with one,

    - if the result fits in the available space, and
    - if the text of the lines indicates this is desirable.

compiler/hlds_out_util.m:
compiler/prog_out.m:
    Move the code for writing out indents from hlds_out_util.m to prog_out.m.
    We now want to call it from error_util.m, and it does not depend on the
    HLDS at all.

tests/invalid/anys_in_negated_contexts.err_exp:
tests/invalid/ho_default_func_1.err_exp:
tests/invalid/ho_default_func_3.err_exp:
tests/invalid/ho_type_mode_bug.err_exp:
tests/invalid/modes_erroneous.err_exp:
tests/invalid_nodepend/errors2.err_exp:
tests/warnings/inconsistent_pred_order.exp:
tests/warnings/subtype_order.exp:
    Don't expect the line-specific indent on blank lines.
2022-10-12 15:34:49 +11:00

22 lines
1.1 KiB
Plaintext

ho_default_func_3.m:037: In clause for `baz(in, out)':
ho_default_func_3.m:037: mode error in conjunction. The next 2 error messages
ho_default_func_3.m:037: indicate possible causes of this error.
ho_default_func_3.m:037:
ho_default_func_3.m:037: In clause for `baz(in, out)':
ho_default_func_3.m:037: in call to function `univ.univ'/1:
ho_default_func_3.m:037: mode error: argument `V_7' and the return value
ho_default_func_3.m:037: `V_6' have the following insts:
ho_default_func_3.m:037: /* unique */ (func(di) = uo is det),
ho_default_func_3.m:037: free
ho_default_func_3.m:037: which does not match any of the modes for function
ho_default_func_3.m:037: `univ.univ'/1.
ho_default_func_3.m:037:
ho_default_func_3.m:037: In clause for `baz(in, out)':
ho_default_func_3.m:037: in call to predicate `univ.univ_to_type'/2:
ho_default_func_3.m:037: mode error: arguments `V_6, Y0' have the following
ho_default_func_3.m:037: insts:
ho_default_func_3.m:037: free,
ho_default_func_3.m:037: free
ho_default_func_3.m:037: which does not match any of the modes for predicate
ho_default_func_3.m:037: `univ.univ_to_type'/2.