[m-rev.] for review: compare du types separately

Peter Wang novalazy at gmail.com
Fri Jul 31 17:19:34 AEST 2026


On Thu, 30 Jul 2026 23:12:16 +0200 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> 
> At the moment, the only way I can see to meet both those objectives
> at the same time is to
> 
> - include both the from-type and the to-type in the coerce_fails
>   that report such problems;
> 
> - looking for symmetric pairs of such coerce_fails, and when found,
>   wrapping them up in a larger coerce_fail that contains both originals,
> 
> - printing both wrapped coerce_fails *after* a prelude that says
>   something to the effect of "the real error is one of these two;
>   I cannot figure out which one it is; that is up to you".
>   Not in exactly those words, of course :-)
> 
> Can you think of a better approach?

If I'm not mistaken, we can find the symmetric pairs close to where they
are generated (in are_actual_param_type_pair_as_related_as_needed),
and the error message could say "Neither X nor Y is a subtype of the
other", right?

Peter


More information about the reviews mailing list