Files
mercury/tests/invalid/test_nested.err_exp
Zoltan Somogyi 31e7fdde70 Generate better messages for errors in foreign_procs.
This fixes mantis bug 363.

compiler/prog_io_pragma.m:
    Remove the old code that deliberately used an old-style argument number
    (derived from the syntax of the long-ago-removed pragma_c_code pragma,
    which did not have a foreign_lang argument) for error messages.
    This was mantis bug 363.

    Put the code for parsing the main components of foreign_procs in
    one place, and parse them in order. If more than one component has
    errors, return all their error messages.

    Change the code that parses foreign_proc attribute lists to return
    an error message for each unrecognized attribute, instead of just
    printing "invalid attribute list".

compiler/error_util.m:
    Have nth_fixed generate words ("fourth", "fifth" etc) up to N = 10,
    and generate e.g. 42nd instead of 42th.

tests/invalid/bug363.{m,err_exp}:
    Add an expanded version of the mantis 363 test case.

tests/invalid/Mmakefile:
    Enable the new test case.

tests/invalid/test_nested.err_exp:
    Conform to the change in error_util.m.
2015-08-23 14:48:13 +10:00

27 lines
1.6 KiB
Plaintext

test_nested.m:013: In module `test_nested':
test_nested.m:013: error in `use_module' declaration:
test_nested.m:013: module `parent.private_child' is inaccessible.
test_nested.m:013: Either there was no prior `import_module' or `use_module'
test_nested.m:013: declaration to import module `parent', or the interface
test_nested.m:013: for module `parent' does not contain an `include_module'
test_nested.m:013: declaration for module `private_child'.
test_nested.m:014: In module `test_nested':
test_nested.m:014: error in `use_module' declaration:
test_nested.m:014: module `parent.undeclared_child' is inaccessible.
test_nested.m:014: Either there was no prior `import_module' or `use_module'
test_nested.m:014: declaration to import module `parent', or the interface
test_nested.m:014: for module `parent' does not contain an `include_module'
test_nested.m:014: declaration for module `undeclared_child'.
test_nested.m:017: In module `test_nested':
test_nested.m:017: error in `use_module' declaration:
test_nested.m:017: module `parent2.child' is inaccessible.
test_nested.m:017: Either there was no prior `import_module' or `use_module'
test_nested.m:017: declaration to import module `parent2', or the interface
test_nested.m:017: for module `parent2' does not contain an `include_module'
test_nested.m:017: declaration for module `child'.
test_nested.m:024: In the fourth argument of function symbol `foo' of the type
test_nested.m:024: `test_nested.foo'/0:
test_nested.m:024: error: undefined type `parent.nonexistent_child.foo'/0.
test_nested.m:024: (The module `parent.nonexistent_child' has not been
test_nested.m:024: imported.)