Files
mercury/tests/warnings/bug412.m
Zoltan Somogyi ec6ca55ea0 Warn about two or more unused imports in bulk.
By reducing redundant verbiage, this change makes finding the actionable
info in (what used to be) a possibly-long list of warnings easier to see.

compiler/unused_imports.m:
    Instead of generating a separate message for each unused import_module
    or use_module declaration in a module, classify those declarations
    into four categories, and generate just one error_spec for each
    nonempty category.

    The four categories are in a 2x2 matrix, based on

    - whether the declaration is import_module or use_module, and on
    - whether the module is unused in the whole module, or just in the
      interface.

tests/warnings/bug412.m:
    Change the code of this test slightly to add an unused module
    that is the sole one it its category, to test both the code for
    reporting individual imports and the code for reporting imports in bulk.

tests/warnings/bug412.err_exp:
    Expect the warning for the new category, and expect the single bulk warning
    for the other unused imports, instead of one warning per import.
2025-05-10 12:51:17 +10:00

39 lines
944 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
:- module bug412.
:- interface.
:- import_module bool.
% Avoid a warning about the module not exporting anything.
:- type blah
---> blah.
:- implementation.
% Test a warning about a module imported in the interface not being used
% in the interface.
:- type blah2
---> blah2(bool).
:- import_module bitmap.
:- import_module bit_buffer.
:- import_module builtin.
:- import_module char.
:- import_module diet.
:- import_module digraph.
:- import_module enum.
:- import_module io.
:- import_module ops.
:- import_module pprint.
:- import_module rtree.
:- import_module store.
:- import_module stream.
:- import_module string.
:- import_module string.builder.
:- import_module table_statistics.
:- import_module term.
:- import_module univ.