mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-22 12:53:47 +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.
5 lines
261 B
Plaintext
5 lines
261 B
Plaintext
coerce_clobbered.m:021: In clause for `bad(in(clobbered), out)':
|
|
coerce_clobbered.m:021: in coerce expression:
|
|
coerce_clobbered.m:021: mode error: the argument term has instantiatedness
|
|
coerce_clobbered.m:021: `clobbered', but it must have a ground inst.
|