[m-rev.] for post-commit review: improve unbound type var warnings

Julien Fischer jfischer at opturion.com
Fri Jun 9 18:26:12 AEST 2023


On Fri, 9 Jun 2023, Zoltan Somogyi wrote:

> 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.

That's fine.

Julien.



More information about the reviews mailing list