Files
mercury/tests/warnings/singleton_test.exp3
Zoltan Somogyi 16b964be81 Improve warnings about unbound type variables.
compiler/post_typecheck.m:
    Do not generate warnings abouts unbound type variables in code
    that is not in the current module.

    If all the variables we are generating a report for have types
    that are *just* type variables, then report just the names
    of the variables; the names of the associated type variables
    are just clutter in that case (especially when those type variables
    are compiler-generated).

    If some of the variables we are generating a report for have types
    that are not just type variables (which can happen when the type is
    e.g. list(T)), then report the type of each variable as before,
    but try to line things up so that all the types start in the same column.
    This should make the message easier to read.

    In both cases, sort the list of variables on their names.

    Update the wording of the warning to accommodate the changes above,
    and to expand contractions.

tests/invalid/bad_sv_unify_msg.err_exp:
tests/invalid/bug257.err_exp:
tests/invalid/coerce_void.err_exp:
tests/invalid/freefree.err_exp:
tests/invalid/typeclass_test_8.err_exp:
tests/invalid/unsatisfiable_constraint.err_exp:
tests/warnings/singleton_test.exp:
tests/warnings/singleton_test.exp2:
tests/warnings/singleton_test.exp3:
    Expect the updated warning text.
2023-06-08 18:58:06 +02:00

29 lines
1.6 KiB
Plaintext

singleton_test.m:013: In function `my_append_func'/2:
singleton_test.m:013: warning: unresolved polymorphism.
singleton_test.m:013: The variables with unbound types were:
singleton_test.m:013: L1
singleton_test.m:013: L2
singleton_test.m:013: Their types will be implicitly set to the builtin type
singleton_test.m:013: `void'.
singleton_test.m:031: In clause for predicate `my_append'/3:
singleton_test.m:031: warning: variable `L2' occurs only once in this scope.
singleton_test.m:035: In clause for function `my_append_func'/2:
singleton_test.m:035: warning: variables `L1, L2' occur only once in this
singleton_test.m:035: scope.
singleton_test.m:036: In clause for function `my_append_func'/2:
singleton_test.m:036: warning: variable `T' occurs only once in this scope.
singleton_test.m:046: In the Java code for predicate `my_c_pred'/3:
singleton_test.m:046: warning: variable `Y' does not occur in the Java code.
singleton_test.m:059: In the Java code for function `my_c_func'/2:
singleton_test.m:059: warning: variable `X' does not occur in the Java code.
singleton_test.m:076: In the Java code for predicate `c_hello_world'/3:
singleton_test.m:076: warning: variable `Msg' does not occur in the Java
singleton_test.m:076: code.
singleton_test.m:082: In clause for predicate `test_head'/6:
singleton_test.m:082: warning: variable `_D' occurs more than once in this
singleton_test.m:082: scope.
singleton_test.m:082: In clause for predicate `test_head'/6:
singleton_test.m:082: warning: variables `A, B' occur only once in this
singleton_test.m:082: scope.
For more information, recompile with `-E'.