Files
mercury/tests/invalid/require_scopes.err_exp
Zoltan Somogyi dcf48e2315 Add a new option, --warn-unsorted-import-blocks.
compiler/options.m:
doc/user_guide.texi:
NEWS.md:
    Add, document and announce the new option. It is off by default,
    but of course I tested its behavior when turned on. Most of this
    diff deals with the consequences.

compiler/item_util.m:
    Add code to generate the new warnings if requested.

compiler/convert_parse_tree.m:
    Request the new warning if the new option is set when processing
    source files..

compiler/handle_options.m:
    Disable all style warnings, including the new one, when generating
    .int* files or .*opt files.

compiler/mercury_compile_main.m:
    Fix an unrelated bug I noticed while working on this diff:
    report the "unfindability" of a given file at most once.

browser/dl.m:
browser/io_action.m:
compiler/mercury_compile_augment.m:
compiler/mercury_compile_llds_back_end.m:
compiler/unused_args.m:
deep_profiler/autopar_find_best_par.m:
deep_profiler/dump.m:
deep_profiler/html_format.m:
deep_profiler/mdprof_create_feedback.m:
deep_profiler/profile.m:
deep_profiler/read_profile.m:
deep_profiler/recursion_patterns.m:
deep_profiler/var_use_analysis.m:
library/array2d.m:
library/bit_buffer.read.m:
library/construct.m:
library/edit_distance.m:
library/library.m:
library/mercury_term_lexer.m:
library/one_or_more_map.m:
library/private_builtin.m:
library/set_bbbtree.m:
library/string.parse_runtime.m:
library/thread.future.m:
library/univ.m:
library/version_array.m:
library/version_bitmap.m:
mdbcomp/program_representation.m:
profiler/call_graph.m:
profiler/demangle.m:
profiler/output.m:
profiler/process_file.m:
profiler/propagate.m:
slice/mdice.m:
slice/mslice.m:
    Fix unsorted import blocks pointed out by the new option.

tests/invalid/ambiguous_overloading_error.err_exp:
tests/invalid/bad_tscp.err_exp:
tests/invalid/bug10.err_exp:
tests/invalid/gh72_errors.err_exp:
tests/invalid/ho_default_func_2.err_exp:
tests/invalid/require_scopes.err_exp:
tests/invalid/type_error_use_module.err_exp:
tests/invalid/types.err_exp:
tests/invalid_nodepend/errors_2.err_exp:
tests/invalid_nodepend/funcs_as_preds.err_exp:
tests/warnings/ambiguous_overloading.err_exp:
tests/warnings/save.err_exp:
tests/warnings/singleton_test.err_exp:
tests/warnings/unused_interface_import.err_exp:
    Update the expected outputs of these test cases to expect the new warning
    for unsorted import blocks in their source files.

tests/invalid/Mercury.options:
tests/invalid_nodepend/Mercury.options:
tests/warnings/Mercury.options:
    Execute those test cases with the warning enabled.

tests/invalid_nodepend/require_tailrec_invalid.m:
tests/invalid_nodepend/specified.m:
tests/recompilation/pragma_type_spec_r.m.1:
tests/recompilation/type_qual_re.m.1:
tests/recompilation/type_qual_re_2.m.1:
tests/recompilation/type_spec_unname_var_r.m.1:
tests/recompilation/type_spec_unname_var_r_2.m.1:
tests/recompilation/type_spec_unname_var_r_2.m.2:
tests/recompilation/unchanged_pred_nr.m.1:
tests/recompilation/with_type_re.m.1:
    Sort the import blocks in these test cases, and where relevant,
    import only one module per line.

tests/recompilation/with_type_re.err_exp.2:
    Expect updated line numbers after splitting a line that imported
    two modules.

tests/warnings/unsorted_import_blocks.{m,err_exp}:
    New test case to exercise one nontrivial part of the sortedness check,
    numerical non-sortedness. (The other affected test cases already exercise
    all the other parts.)

tests/warnings/Mmakefile:
    Enable the new test case.
2025-01-21 19:19:33 +11:00

1.9 KiB

require_scopes.m:016: Warning: this `:- import_module' declaration for module
require_scopes.m:016: `solutions' is out of order with respect to the
require_scopes.m:016: preceding `:- import_module' declaration for module
require_scopes.m:016: `string'.
require_scopes.m:036: Error: the required determinism of the goal in this scope
require_scopes.m:036: is `det', but its actual determinism is `semidet'.
require_scopes.m:037: This call to predicate `int.>'/2 can fail.
require_scopes.m:040: Error: the required determinism of the goal in this scope
require_scopes.m:040: is `nondet', but its actual determinism is `semidet'.
require_scopes.m:064: Error: the switch on `A' is required to be complete, but
require_scopes.m:064: it does not cover
require_scopes.m:064: `f1'/0.
require_scopes.m:097: Error: the arms of the switch on `A' are required have a
require_scopes.m:097: determinism that is acceptable in a `det' context, but
require_scopes.m:097: the actual determinism of the arm for
require_scopes.m:097: require_scopes.f3/1 is `semidet'.
require_scopes.m:098: This call to predicate `int.>'/2 can fail.
require_scopes.m:109: Error: the arms of the switch on `B' are required have a
require_scopes.m:109: determinism that is acceptable in a `semidet' context,
require_scopes.m:109: but the actual determinism of the arm for 10 is
require_scopes.m:109: `multi'.
require_scopes.m:110: Disjunction has more than one disjunct with solutions.
require_scopes.m:111: This later disjunct may have a solution.