Files
mercury/tests/invalid/pragma_qual_error.err_exp
Zoltan Somogyi 7424f93a30 Use one error msg for undeclared mode references.
compiler/add_clause.m:
compiler/make_hlds_passes.m:
    We used to have two separate predicates for generating error messages
    about references to undeclared modes of predicates and functions.
    One, in add_clause.m, was for undeclared modes in mode-specific clauses,
    and generated messages that were as informative as possible.
    The other, in make_hlds_passes.m, which was used for undeclared modes
    in type_spec in foreign_export pragmas, was perfunctory, and gave
    no details.

    Act on an old XXX and delete the second predicate, replacing its uses
    by calls to the first. To make this possible, move the first predicate,
    which used to be private to add_clause.m, to make_hlds_passes.m.

compiler/add_pragma.m:
compiler/add_pragma_type_spec.m:
    Call the first predicate, not the second.

compiler/prog_item.m:
    The first predicate requires access to a varset that describes the names
    of any inst variables in the undeclared mode. Include a varset for this
    purpose in foreign_export pragmas. (type_spec pragmas already had the
    required varset.)

compiler/convert_parse_tree.m:
compiler/get_dependencies.m:
compiler/item_util.m:
compiler/make_hlds_error.m:
compiler/module_qual.qualify_items.m:
compiler/parse_pragma_foreign.m:
compiler/parse_tree_out_pragma.m:
compiler/prog_mutable.m:
    Conform to the change in prog_item.m.

tests/invalid/pragma_qual_error.err_exp:
tests/invalid/type_spec.err_exp:
    Expect updated error messages.
2022-02-23 04:31:38 +11:00

33 lines
2.0 KiB
Plaintext

pragma_qual_error.m:025: In `:- pragma foreign_export_enum' declaration:
pragma_qual_error.m:025: error: undefined type `bar'/0.
pragma_qual_error.m:032: Error: `:- pragma foreign_enum' declaration for the
pragma_qual_error.m:032: undeclared type `bar'/0.
pragma_qual_error.m:046: Error: `:- pragma foreign_proc' declaration for
pragma_qual_error.m:046: undeclared mode of predicate
pragma_qual_error.m:046: `pragma_qual_error.foo'/2.
pragma_qual_error.m:046: In `:- pragma foreign_proc' declaration:
pragma_qual_error.m:046: error: undefined mode `not_a_mode'/0.
pragma_qual_error.m:060: Error: `:- pragma memo' declaration for undeclared
pragma_qual_error.m:060: mode of predicate `pragma_qual_error.memoproc'/3.
pragma_qual_error.m:060: In `:- pragma memo' declaration:
pragma_qual_error.m:060: error: undefined mode `not_a_mode'/0.
pragma_qual_error.m:071: Error: `:- pragma loop_check' declaration for
pragma_qual_error.m:071: undeclared mode of predicate
pragma_qual_error.m:071: `pragma_qual_error.loop_check_proc'/2.
pragma_qual_error.m:071: In `:- pragma loop_check' declaration:
pragma_qual_error.m:071: error: undefined mode `not_a_mode'/0.
pragma_qual_error.m:088: Error: `:- pragma minimal_model_stack_copy'
pragma_qual_error.m:088: declaration for undeclared mode of predicate
pragma_qual_error.m:088: `pragma_qual_error.tc'/2.
pragma_qual_error.m:088: In `:- pragma minimal_model' declaration:
pragma_qual_error.m:088: error: undefined mode `not_a_mode'/0.
pragma_qual_error.m:112: In `:- pragma type_spec' declaration:
pragma_qual_error.m:112: error: undefined mode `not_a_mode'/0.
pragma_qual_error.m:112: In `:- pragma type_spec' declaration:
pragma_qual_error.m:112: error: undefined type `not_a_type'/0.
pragma_qual_error.m:112: In `:- pragma type_spec' declaration for predicate
pragma_qual_error.m:112: `type_spec_pred'/2:
pragma_qual_error.m:112: error: mode annotation specifies undeclared mode
pragma_qual_error.m:112: `type_spec_pred(in, not_a_mode)'.
For more information, recompile with `-E'.