[m-rev.] for review: improve messages for some mode errors
Julien Fischer
jfischer at opturion.com
Fri Jan 24 14:07:48 AEDT 2020
On Fri, 24 Jan 2020, Zoltan Somogyi wrote:
> For review by anyone.
> Improve error messages for some mode errors.
>
> compiler/mode_errors.m:
> There are two improvements.
>
> The first and much the more important is that when a call does not match
> any of the declared modes of the called predicate or function, we now
> print the names and insts of any arguments whose insts, by themselves,
> do not match any of the callee's modes. Instead of reporting "here are
> all the arguments, here are all their insts, find out for yourself
> which one is wrong", the compiler now tells the programmer explicitly
> which one is wrong in almost all cases. (Not all. If e.g. two args <A, B>
> have insts <free, free>, but the callee has two modes, <in, out> and
> <out, in>, then the compiler won't report either arg, since neither arg
> is wrong by itself.)
>
> The second improvement is that when the verbosity settings ask us
> to print all possible reasons why we can't schedule a conjunction,
> instead of our default approach of printing the only the first,
> we now put a blank line between the different reasons, for visual
> separation.
That looks fine; did you intend this for the release branch as well?
Julien.
More information about the reviews
mailing list