mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-20 20:03:44 +00:00
compiler/hlds_error_util.m:
When creating format_pieces identifying one procedure of a predicate
or function, use just the id of the predicate or function itself
if it has no other procedures. This avoids cluttering diagnostics
with irrelevant details.
Replace two separate functions that used to construct such ids with one.
The difference was that one got the actual arg modes from a pred_info,
while the other allowed the caller to supply any modes it wanted, but
all callers (except one) of the second variant got the arg modes
the exact same way the first variant did. The one exception got them
from the *declared* arg modes field of the pred_info, which was a bug,
because would have generated unusable output if the predicate or function
had no declared modes, and got all its modes by inference.
Put all the functions involved in all of the above into a logical order.
compiler/det_analysis.m:
compiler/det_report.m:
compiler/simplify_goal_call.m:
compiler/stratify.m:
Conform to the changes in hlds_error_util.m.
In some places, improve diagnostics in other ways as well.
tests/general/Mercury.options:
tests/general/Mmakefile:
tests/warnings/Mmakefile:
tests/warnings/petdr1.{m,err_exp}:
Move the petdr1 test case from general to warnings. This case
never generated any output; its intended use was to check for
the absence of a compiler abort in the generation of some warnings.
In its new home, it tests that *and* the texts of the warnings.
tests/invalid/bug150.err_exp:
tests/invalid/bug150_partial_color.err_exp:
tests/invalid/bug496.err_exp:
tests/invalid/det_atomic_goal_msgs.err_exp:
tests/invalid/det_errors.err_exp:
tests/invalid/det_errors_and_io.err_exp:
tests/invalid/det_errors_deep.err_exp:
tests/invalid/erroneous_throw_promise.err_exp:
tests/invalid/hawkins_mm_fail_reset.err_exp:
tests/invalid/ho_unique_error.err_exp:
tests/invalid/io_in_ite_cond.err_exp:
tests/invalid/loopcheck.err_exp:
tests/invalid/magicbox.err_exp:
tests/invalid/mostly_uniq_1.err_exp:
tests/invalid/mostly_uniq_2.err_exp:
tests/invalid/multisoln_func.err_exp:
tests/invalid/not_a_switch.err_exp:
tests/invalid/one_member.err_exp:
tests/invalid/pragma_c_code_no_det.err_exp:
tests/invalid/ref_to_implicit_comma.err_exp:
tests/invalid/ref_to_implicit_pred.err_exp:
tests/invalid/require_det_in_lambda.err_exp:
tests/invalid/require_scopes.err_exp:
tests/invalid/try_detism.err_exp:
tests/invalid/user_field_access_decl_override_1.err_exp:
tests/invalid_nodepend/invalid_main.err_exp:
tests/invalid_nodepend/occurs.err_exp:
tests/warnings/det_infer_warning.err_exp:
tests/warnings/non_stratification.err_exp:
tests/warnings/obsolete_proc_pragma.err_exp:
Expect the updated diagnostics.
13 lines
1.0 KiB
Plaintext
13 lines
1.0 KiB
Plaintext
loopcheck.m:011: Warning: the determinism declaration for predicate [38;5;87m`main'/2[39;49m
|
||
loopcheck.m:011: [38;5;203mcould be tighter.[39;49m
|
||
loopcheck.m:011: Declared [38;5;40m`det',[39;49m inferred [38;5;203m`erroneous'.[39;49m
|
||
loopcheck.m:020: Error: [38;5;87m`:- pragma loop_check' declarations[39;49m are [38;5;203mnot allowed[39;49m for
|
||
loopcheck.m:020: procedures with determinism [38;5;203m`erroneous'.[39;49m
|
||
loopcheck.m:020: This pragma is valid only for the following determinisms:
|
||
loopcheck.m:020: [38;5;40mcc_multi,[39;49m [38;5;40mcc_nondet,[39;49m [38;5;40mdet,[39;49m [38;5;40mmulti,[39;49m [38;5;40mnondet[39;49m and [38;5;40msemidet.[39;49m
|
||
loopcheck.m:023: Warning: recursive call to predicate [38;5;87m`loop'/1[39;49m [38;5;203mwill lead to[39;49m
|
||
loopcheck.m:023: [38;5;203minfinite recursion.[39;49m
|
||
loopcheck.m:023: If this recursive call is executed, the procedure will call
|
||
loopcheck.m:023: itself with exactly the same input arguments, leading to
|
||
loopcheck.m:023: infinite recursion.
|