[m-rev.] for post-commit review: report on more kinds of coerce_fails

Peter Wang novalazy at gmail.com
Tue Jul 28 12:10:59 AEST 2026


On Mon, 27 Jul 2026 13:23:13 +0200 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> > > diff --git a/tests/invalid/coerce_unify_tvars.err_exp b/tests/invalid/coerce_unify_tvars.err_exp
> > > index 7e3294902..ef2d295c2 100644
> > > --- a/tests/invalid/coerce_unify_tvars.err_exp
> > > +++ b/tests/invalid/coerce_unify_tvars.err_exp
> > > @@ -1,3 +1,5 @@
> > >  coerce_unify_tvars.m:063: In clause for predicate `head_type_params'/2:
> > >  coerce_unify_tvars.m:063:   error: cannot coerce `X' from `list.list(V_1)' to
> > >  coerce_unify_tvars.m:063:   `list.list(V_2)'.
> > > +coerce_unify_tvars.m:063:   Type variables such as T2 and T1 cannot be either
> > > +coerce_unify_tvars.m:063:   coerced from, or coerced to.
> > 
> > Suggestion:
> > 
> >     The coercion is invalid because the unconstrained type variables V_1
> >     and V_2 are not known to be equal or to have a subtype relationship.
> 
> How about this:
> 
> {An unconstrained type variable such as V_1, Unconstrained type variables
> such as V_1 and V_2} cannot be either coerced from or coerced to, because
> by definition, {it is,they are} not known to be either equal to any type, or to be
> in a subtype relationship with any type.

I think you can remove "by definition", but that's okay.

Peter


More information about the reviews mailing list