mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
Make an error message more inclusive.
compiler/comp_unit_interface.m:
When we cannot generate a .int0/.int/.int2 file because of file access
issues, the reason is *usually* that we can't read a .int3 file.
However, it is also possible that the reason is that we can't read
a .int0 file, so include that possibility in the overall error message.
(The "can't read this file" message, with the specifics of the file
that couldn't be read, would have been printed earlier.)
tests/invalid_make_int/missing_parent_import.int_err_exp:
tests/invalid_make_int/sub_c.int_err_exp:
tests/invalid_make_int/test_nested.int_err_exp:
Expect the updated error message.
This commit is contained in:
@@ -621,7 +621,7 @@ generate_parse_tree_int0(ProgressStream, Globals, AddToHptm, BurdenedModule,
|
||||
else
|
||||
% The negative indent is to let the rest of the error_spec
|
||||
% start at the left margin.
|
||||
PrefixPieces = [words("Error reading interface files."),
|
||||
PrefixPieces = [words("Error reading .int3 and/or .int0 files."),
|
||||
nl_indent_delta(-1)],
|
||||
GenerateResult = gpti0_error(ModuleName, PrefixPieces, GetSpecs)
|
||||
).
|
||||
@@ -777,7 +777,7 @@ generate_parse_tree_int12(ProgressStream, Globals, AddToHptm,
|
||||
else
|
||||
% The negative indent is to let the rest of the error_spec
|
||||
% start at the left margin.
|
||||
PrefixPieces = [words("Error reading .int3 files."),
|
||||
PrefixPieces = [words("Error reading .int3 and/or .int0 files."),
|
||||
nl_indent_delta(-1)],
|
||||
GenerateResult = gpti12_error(ModuleName, PrefixPieces, GetSpecs)
|
||||
).
|
||||
|
||||
@@ -6,5 +6,5 @@ missing_parent_import.m:028: to the `:- import_module' and `:- use_module'
|
||||
missing_parent_import.m:028: declarations for its child modules
|
||||
missing_parent_import.m:028: `missing_parent_import_helper_1.child' and
|
||||
missing_parent_import.m:028: `missing_parent_import_helper_1.child2'.
|
||||
Error reading .int3 files.
|
||||
Error reading .int3 and/or .int0 files.
|
||||
`missing_parent_import.int' and `missing_parent_import.int2' not written.
|
||||
|
||||
@@ -3,5 +3,5 @@ sub_c.m:015: the absence of an `:- import_module' or `:- use_module'
|
||||
sub_c.m:015: declaration for `sub_c_helper_1' prevents access to the
|
||||
sub_c.m:015: `:- import_module' declaration for its child module
|
||||
sub_c.m:015: `sub_c_helper_1.sub1'.
|
||||
Error reading .int3 files.
|
||||
Error reading .int3 and/or .int0 files.
|
||||
`sub_c.int' and `sub_c.int2' not written.
|
||||
|
||||
@@ -7,5 +7,5 @@ test_nested.m:017: the absence of an `:- import_module' or `:- use_module'
|
||||
test_nested.m:017: declaration for `test_nested_helper_2' prevents access to
|
||||
test_nested.m:017: the `:- use_module' declaration for its child module
|
||||
test_nested.m:017: `test_nested_helper_2.test_nested_helper_6'.
|
||||
Error reading .int3 files.
|
||||
Error reading .int3 and/or .int0 files.
|
||||
`test_nested.int' and `test_nested.int2' not written.
|
||||
|
||||
Reference in New Issue
Block a user