Commit Graph

3 Commits

Author SHA1 Message Date
Zoltan Somogyi
209c546a77 Explain the components of determinism error msgs.
compiler/det_report.m:
    When we report that a predicate does not satisfy the requirements
    of its determinism declaration, we follow that statement with a list
    of statements about pieces of code that all contribute to that mismatch.
    However, a thread on m-users last month showed that some users did not
    make that connection. So add an explicit statement to that effect.

tests/invalid/bug150.err_exp:
tests/invalid/bug496.err_exp:
tests/invalid/det_atomic_goal_msgs.err_exp:
tests/invalid/det_errors.err_exp:
tests/invalid/magicbox.err_exp:
tests/invalid/not_a_switch.err_exp:
tests/invalid/try_detism.err_exp:
tests/invalid/user_field_access_decl_override.err_exp:
    Expect updated error messages.
2021-08-27 21:57:01 +10:00
Zoltan Somogyi
fdd141bf77 Clean up the tests in the other test directories.
tests/invalid/*.{m,err_exp}:
tests/misc_tests/*.m:
tests/mmc_make/*.m:
tests/par_conj/*.m:
tests/purity/*.m:
tests/stm/*.m:
tests/string_format/*.m:
tests/structure_reuse/*.m:
tests/submodules/*.m:
tests/tabling/*.m:
tests/term/*.m:
tests/trailing/*.m:
tests/typeclasses/*.m:
tests/valid/*.m:
tests/warnings/*.{m,exp}:
    Make these tests use four-space indentation, and ensure that
    each module is imported on its own line. (I intend to use the latter
    to figure out which subdirectories' tests can be executed in parallel.)

    These changes usually move code to different lines. For the tests
    that check compiler error messages, expect the new line numbers.

browser/cterm.m:
browser/tree234_cc.m:
    Import only one module per line.

tests/hard_coded/boyer.m:
    Fix something I missed.
2015-02-16 12:32:18 +11:00
Zoltan Somogyi
ac47aec0a5 Fix Mantis bug #150.
Estimated hours taken: 4
Branches: main

Fix Mantis bug #150.

The bug was that compiler error messages about determinism errors could refer
to a function's determinism declaration even if the function had NO
determinism declaration, and the compiler took its determinism to be
IMPLICITLY declared to be det.

compiler/hlds_pred.m:
	Add a field to the proc_info that records whether the determinism
	declaration (if any) was explicit or implicit.

	Improve the style of the proc_info_set_* predicates' clauses.

compiler/accumulator.m:
compiler/add_pred.m:
compiler/add_special_pred.m:
compiler/check_typeclass.m:
compiler/clause_to_proc.m:
compiler/lambda.m:
compiler/make_hlds.m:
compiler/stm_expand.m:
compiler/table_gen.m:
compiler/unify_proc.m:
	Set this field when creating new procedures.

compiler/det_report.m:
	Use this field to match the wording of the error message to the given
	circumstances.

tests/invalid/bug150.m:
	Add the regression test for this bug.

tests/invalid/Mmakefile:
tests/invalid/Mercury.options:
	Enable the test case.
2010-09-15 04:35:34 +00:00