Files
mercury/mdbcomp
Zoltan Somogyi bd6e6fca8c Diagnose names with non-full qualifications.
compiler/typecheck_errors.m:
    When the program refers to a predicate, function or data constructor
    from a module with only a use_module declaration, it must do so
    using its fully qualified name. If it refers to it with an unqualified
    or only partially qualified name, the typechecker won't find it,
    because the predicate_table and the cons_table record non-fully-qualified
    names only for the entities imported with import_module declarations.

    When generating error_specs for such errors, look for matches with
    the relevant name among the fully-qualified entries in the predicate
    and cons tables. If we find some, add a sentence to the error message
    about the modules defining such names being imported with use_module,
    not import_module.

compiler/hlds_cons.m:
    Add a way to look up the definitions of all the constructors with
    a given name.

compiler/pred_table.m:
    Add a way to look up the definitions of all the predicates or functions
    with a given name.

mdbcomp/sym_name.m:
    Add some functionality for use by typecheck_errors.m.

tests/invalid/type_error_use_module.m:
tests/invalid/type_error_use_module_2.m:
tests/invalid/type_error_use_module.err_exp:
    A test case for the new functionality.

tests/invalid/Mmakefile:
tests/invalid/Mercury.options:
    Enable the new test case. Sort the list of multimodule tests.

tests/invalid/errors2.err_exp:
    Expect the new addendum to an existing error message.
2021-04-26 23:47:03 +10:00
..