mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 01:13:30 +00:00
This implements some improvements to its idea from 2022 mar 19 on m-rev.
compiler/check_typeclass.m:
Consider an instance justifiably kept private if a constraint
on the instance refers to a private type class or type constructor.
Extend the test for what is considered "private" to also include
classes and type constructs that are defined in private submodules
of the current module.
Extend the text of the warning to explain the reasoning behind it.
compiler/options.m:
Extend the documentation of the option to explain the reasoning
behind it.
tests/invalid/impure_method_impl.err_exp:
tests/invalid/inconsistent_instances.err_exp:
tests/invalid/method_impl.err_exp:
tests/invalid/mpj_3.err_exp:
tests/invalid/mpj_4.err_exp:
tests/invalid/range_restrict.err_exp:
tests/warnings/unused_interface_import.err_exp:
Expect the new text for the warning.
tests/warnings/help_text.err_exp:
Expect the new help text.
1.5 KiB
1.5 KiB
unused_interface_import.m:009: In module `unused_interface_import':
unused_interface_import.m:009: warning: module
unused_interface_import.m:009: `unused_interface_import_helper_1' is imported
unused_interface_import.m:009: in the interface, but it is not used in the
unused_interface_import.m:009: interface.
unused_interface_import.m:009: Warning: this `:- import_module' declaration for
unused_interface_import.m:009: module `unused_interface_import_helper_1' is
unused_interface_import.m:009: out of order with respect to the preceding
unused_interface_import.m:009: `:- import_module' declaration for module
unused_interface_import.m:009: `unused_interface_import_helper_2'.
unused_interface_import.m:017: Warning: the type class
unused_interface_import.m:017: `unused_interface_import.tc1'/1 and the type
unused_interface_import.m:017: constructor in the argument vector of this
unused_interface_import.m:017: instance declaration for it, namely
unused_interface_import.m:017: `unit.unit'/0, are all visible outside this
unused_interface_import.m:017: module, which means that this instance can be
unused_interface_import.m:017: relevant outside this module. Keeping it
unused_interface_import.m:017: private to this module is therefore likely to
unused_interface_import.m:017: be a mistake.
unused_interface_import.m:009: warning: module
unused_interface_import.m:009: `unused_interface_import_helper_1' is imported
unused_interface_import.m:009: in the interface, but it is not used in the
unused_interface_import.m:009: interface.
unused_interface_import.m:009: Warning: this `:- import_module' declaration for
unused_interface_import.m:009: module `unused_interface_import_helper_1' is
unused_interface_import.m:009: out of order with respect to the preceding
unused_interface_import.m:009: `:- import_module' declaration for module
unused_interface_import.m:009: `unused_interface_import_helper_2'.
unused_interface_import.m:017: Warning: the type class
unused_interface_import.m:017: `unused_interface_import.tc1'/1 and the type
unused_interface_import.m:017: constructor in the argument vector of this
unused_interface_import.m:017: instance declaration for it, namely
unused_interface_import.m:017: `unit.unit'/0, are all visible outside this
unused_interface_import.m:017: module, which means that this instance can be
unused_interface_import.m:017: relevant outside this module. Keeping it
unused_interface_import.m:017: private to this module is therefore likely to
unused_interface_import.m:017: be a mistake.