mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-18 10:53:40 +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.
16 lines
865 B
Plaintext
16 lines
865 B
Plaintext
getopt_old.m:027: In clause for predicate `main'/2:
|
|
getopt_old.m:027: in argument 2 of call to predicate `io.format'/4:
|
|
getopt_old.m:027: in list element #0:
|
|
getopt_old.m:027: in unification of argument
|
|
getopt_old.m:027: and term `s(ErrorMsg)':
|
|
getopt_old.m:027: type error in argument of functor `s'/1.
|
|
getopt_old.m:027: Argument 1 (ErrorMsg) has type
|
|
getopt_old.m:027: getopt.option_error(getopt_old.option),
|
|
getopt_old.m:027: expected type was
|
|
getopt_old.m:027: string.
|
|
getopt_old.m:027: One possible reason for the error is that the signatures of
|
|
getopt_old.m:027: the option processing predicates in the `getopt' module
|
|
getopt_old.m:027: have changed recently. Errors are now returned in a
|
|
getopt_old.m:027: structured form, which can be converted to a string by
|
|
getopt_old.m:027: calling the `option_error_to_string' function.
|