Commit Graph

3 Commits

Author SHA1 Message Date
Zoltan Somogyi
939c9cb063 Address Julien's review comments.
doc/reference_manual.texi:
    Give a reason why nonabstract instance declarations may not appear
    in interface sections. To make this reason understandable, delay it
    until we have discussed method definitions.

    Add an example of an abstract instance declaration with a typeclass
    constraint.

compiler/split_parse_tree_src.m:
    Improve the wording along lines suggested by Julien.

tests/invalid_nodepend/instance_bug.err_exp:
    Expect the updated wording.
2022-02-03 13:16:48 +11:00
Zoltan Somogyi
0b7282d701 Require non-abstract instances in interfaces.
doc/reference_manual.texi:
    As above. The compiler enforced this requirement since April 2005,
    but the manual was silent on the matter.

compiler/split_parse_tree_src.m:
    When we detect an abstract instance declaration in the interface section,
    extend the error message with a verbose-only mention of the usual fix.

tests/invalid_nodepend/Mercury.options:
    Turn on verbose errors for this test case, which tests this error message.

tests/invalid_nodepend/instance_bug.err_exp:
    Expect the new verbose component.
2022-02-03 10:56:54 +11:00
Zoltan Somogyi
6413b4fb08 Create invalid_nodepend and invalid_onlydepend.
tests/invalid_onlydepend:
    Move the one test case in tests/invalid for which we want to check
    the error messages generated during the generation of dependencies
    to this new test directory.

tests/invalid_nodepend:
    Move all test cases in tests/invalid which get errors during the
    generation of dependencies but for which we want to check the error
    messages generated during normal compilation to this new test directory.

tests/invalid_nodepend/Mmakefile:
tests/invalid_nodepend/Mercury.options:
tests/invalid_onlydepend/Mmakefile:
tests/invalid_onlydepend/Mercury.options:
    Versions of the same files in tests/invalid, but containing only
    the entries relevant to the moved test cases.

tests/invalid/Mmakefile:
tests/invalid/Mercury.options:
    Delete the entries that refer to the moved test cases.

tests/README:
    Document the two new test directories.

tools/bootcheck:
    Add invalid_onlydepend and invalid_nodepend to the list of
    test directories.
2021-07-28 00:59:04 +10:00