[m-rev.] for review: improve messages for some mode errors

Julien Fischer jfischer at opturion.com
Fri Jan 24 15:27:58 AEDT 2020


On Fri, 24 Jan 2020, Zoltan Somogyi wrote:

> 2020-01-24 14:07 GMT+11:00 Julien Fischer<jfischer at opturion.com>:
>> That looks fine;
>
> Thanks.
>
>> did you intend this for the release branch as well?
>
> I am in two minds about that. In the vast majority of cases,
> identifying the arg(s) responsible for the mode error is definitely
> a help. On the other hand, in some rare cases, the error message
> is slightly misleading. In one test case, the error message is for
> a recursive call. One argument is the same in both the head and
> the call, so their modes match exactly, yet there is an error in the
> mode anyway: the mode is "in(pred(in, in, out) is det)", which is
> wrong *only* because the *type* of the argument is a predicate
> of arity five, not three. Both the old error message, and the new
> addition, say that the problem is with the inst, but in this case,
> it is actually with the inst/type combination. A later diff could
> point this out. That diff will happen on the development branch,
> but probably not in the near future, so it probably won't make it
> into the release.
>
> So the question for everybody is: should we include this diff
> in the release because it is useful in the vast majority of cases,
> or should we exclude it because of the potential for adding
> a slight increment of confusion in a small minority of cases?

It may as well go in; I will merge it on to the release branch
this evening, unless someone objects.

Julien.


More information about the reviews mailing list