mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-24 05:43:53 +00:00
compiler/mode_errors.m:
Replace the two existing options for coerce mode errors with one
that includes:
- the path to the input subterm where the error was detected
- the type of the input subterm
- the target type that the subterm should be converted to
- the reason for the error
compiler/modecheck_coerce.m:
Modify the code to produce the above information.
Semidet predicates that previously failed when an error is detected
are changed to det predicates that return the error information.
In a couple of places where predicates previously would fail,
we now abort because the conditions should not occur.
compiler/hlds_out_util.m:
Describe coerce as "coerce expression" (shows up in mode errors).
tests/invalid/Mmakefile:
tests/invalid/coerce_mode_error2.err_exp:
tests/invalid/coerce_mode_error2.m:
Add test case.
tests/invalid/coerce_clobbered.err_exp:
tests/invalid/coerce_implied_mode.err_exp:
tests/invalid/coerce_instvar.err_exp:
tests/invalid/coerce_int.err_exp:
tests/invalid/coerce_mode_error.err_exp:
tests/invalid/coerce_recursive_inst.err_exp:
tests/invalid/coerce_recursive_type.err_exp:
tests/invalid/coerce_unreachable.err_exp:
Update expected error messages.
10 lines
551 B
Plaintext
10 lines
551 B
Plaintext
coerce_unreachable.m:027: In clause for `p1(in, out)':
|
|
coerce_unreachable.m:027: in coerce expression:
|
|
coerce_unreachable.m:027: mode error: cannot convert the argument term from
|
|
coerce_unreachable.m:027: type `coerce_unreachable.fruit' to
|
|
coerce_unreachable.m:027: `coerce_unreachable.citrus' because it has
|
|
coerce_unreachable.m:027: instantiatedness `ground', and
|
|
coerce_unreachable.m:027: `coerce_unreachable.fruit' is not a subtype of
|
|
coerce_unreachable.m:027: `coerce_unreachable.citrus'.
|
|
For more information, recompile with `-E'.
|