mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-19 11:23:46 +00:00
compiler/mode_errors.m:
When generating an error message for a bad higher order inst,
print the specific cause of the mismatch, instead of just
"actual inst is X, expected inst was Y".
compiler/modecheck_call.m:
Change the code that generates that error to record the specific cause
in the mode_error structure of the error.
tests/invalid/higher_order_mode_mismatch.{m,err_exp}:
Add a new test case for the specific causes that other test cases
don't already cover. (As it happens, most of those causes can't be
caught by mode analysis because typechecking reports them first,
but it did so in ways that could be improved. Hence the change to
typecheck_errors.m and most of the .err_exp files below.)
tests/invalid/Mmakefile:
Enable the new test case.
compiler/typecheck_errors.m:
Instead of generating output of the form
<something> has type `abc',
expected type was `def'
generate output of the form
<something> has type
abc,
expected type was
def
The indentation directs the eye to the differences that matter,
and automatically lines up any corresponding parts of the actual
and expected types. It also replaces the quotes as a method
of separating the types being referred to from their surroundings.
tests/invalid/abstract_eqv.err_exp:
tests/invalid/actual_expected.err_exp:
tests/invalid/anys_in_negated_contexts.err_exp:
tests/invalid/arg_permutation.err_exp:
tests/invalid/bad_statevar_bad_context.err_exp:
tests/invalid/bug197.err_exp:
tests/invalid/comparison.err_exp:
tests/invalid/error_in_list.err_exp:
tests/invalid/ext_type.err_exp:
tests/invalid/ext_type_bug.err_exp:
tests/invalid/foreign_procs_exist_type.err_exp:
tests/invalid/getopt_old.err_exp:
tests/invalid/ho_type_arity_bug.err_exp:
tests/invalid/ho_type_mode_bug.err_exp:
tests/invalid/illtyped_compare.err_exp:
tests/invalid/integral_constant_no_suffix.err_exp:
tests/invalid/method_impl.err_exp:
tests/invalid/mixed_up_streams.err_exp:
tests/invalid/mpj1.err_exp:
tests/invalid/mpj4.err_exp:
tests/invalid/no_method.err_exp:
tests/invalid/nullary_ho_func_error.err_exp:
tests/invalid/overloading.err_exp:
tests/invalid/record_syntax_errors.err_exp:
tests/invalid/try_bad_params.err_exp:
tests/invalid/type_error_ambiguous.err_exp:
tests/invalid/type_error_in_arg.err_exp:
tests/invalid/type_mismatch.err_exp:
tests/invalid/types2.err_exp:
tests/invalid/user_field_access_decl_override2.err_exp:
tests/invalid_nodepend/errors2.err_exp:
tests/invalid_purity/impure_func_t5.err_exp:
tests/invalid_purity/impure_pred_t1.err_exp:
tests/invalid_purity/impure_pred_t1_fixed.err_exp:
tests/invalid_purity/impure_pred_t2.err_exp:
tests/invalid_purity/purity_nonsense2.err_exp:
tests/invalid_purity/purity_type_error.err_exp:
Expect the updated error messages.
tests/invalid/ho_type_mode_bug.m:
Update obsolete comments.
32 lines
1.5 KiB
Plaintext
32 lines
1.5 KiB
Plaintext
arg_permutation.m:020: In clause for predicate `main'/2:
|
|
arg_permutation.m:020: in call to predicate `arg_permutation.test'/5:
|
|
arg_permutation.m:020: in argument 1:
|
|
arg_permutation.m:020: variable `A' has type
|
|
arg_permutation.m:020: float,
|
|
arg_permutation.m:020: expected type was
|
|
arg_permutation.m:020: int
|
|
arg_permutation.m:020: (the actual type is the same as the expected type of
|
|
arg_permutation.m:020: argument 2, which is variable `B', and argument 5);
|
|
arg_permutation.m:020: in argument 2:
|
|
arg_permutation.m:020: variable `B' has type
|
|
arg_permutation.m:020: int,
|
|
arg_permutation.m:020: expected type was
|
|
arg_permutation.m:020: float
|
|
arg_permutation.m:020: (the actual type is the same as the expected type of
|
|
arg_permutation.m:020: argument 1, which is variable `A');
|
|
arg_permutation.m:020: in argument 4:
|
|
arg_permutation.m:020: argument has type
|
|
arg_permutation.m:020: float,
|
|
arg_permutation.m:020: expected type was
|
|
arg_permutation.m:020: string
|
|
arg_permutation.m:020: (the actual type is the same as the expected type of
|
|
arg_permutation.m:020: argument 2, which is variable `B', and argument 5);
|
|
arg_permutation.m:020: in argument 5:
|
|
arg_permutation.m:020: argument has type
|
|
arg_permutation.m:020: string,
|
|
arg_permutation.m:020: expected type was
|
|
arg_permutation.m:020: float
|
|
arg_permutation.m:020: (the actual type is the same as the expected type of
|
|
arg_permutation.m:020: argument 4).
|
|
For more information, recompile with `-E'.
|