Files
mercury/tests/warnings/unneeded_mode_specific_clause.exp
Zoltan Somogyi 0186a64520 Warn for unneeded use of mode-specific clauses.
compiler/add_clause.m:
    Generate a warning for mode-specific clauses when the clause is for
    a predicate that has only one mode, provided that the warning is enabled.

compiler/options.m:
    Add an option to enable this warning.

doc/user_guide.texi:
    Document this option.

library/exception.m:
library/int.m:
library/rtti_implementation.m:
library/string.m:
    Delete modes from clause heads that would get this warning.

tests/valid/spurious_purity_warning.m:
    Delete modes from clause heads that would get this warning.

    Do not interleave predicate definitions.

tests/warnings/unneeded_mode_specific_clause.{m,exp}:
    A test case for this warning.
tests/warnings/Mmakefile:
    Enable the new test case.

tests/invalid/multimode_syntax.err_exp:
    Expect the new warning.
2022-04-13 23:39:23 +10:00

4 lines
230 B
Plaintext

unneeded_mode_specific_clause.m:014: Warning: the predicate `test_x'/2 has only
unneeded_mode_specific_clause.m:014: one mode, so there is no need to
unneeded_mode_specific_clause.m:014: restrict a clause for it to that mode.