[m-rev.] for review: diffs for arg type lists

Julien Fischer jfischer at opturion.com
Thu Jan 3 19:38:35 AEDT 2019


Hi Zoltan,

On Thu, 3 Jan 2019, Zoltan Somogyi wrote:

> On Wed, 02 Jan 2019 21:16:45 +1100 (AEDT), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
>>> This test should be more comprehensive, for example if the declaration or
>>> clause has arity 0, if there is more than one difference between the lists,
>>> where the declaration involved is a function etc.
>>
>> Will do.
>
> Just as well you asked for that. The extensions to both test cases detected bugs,
> which the attached committed diff fixes.
>
> You may wish to have a look at both test cases to see if they meet with your
> approval in their current form.

I've just had a play around with this and there is another issue:

     :- module foo.
     :- interface.

     :- pred q1(int::out) is det.

     :- implementation.

     q1(3, "abc").

produces:

    foo.m:004: Error: no clauses for predicate `q1'/1.
    foo.m:008: Error: clause for predicate `foo.q1'/2
    foo.m:008:   without corresponding `:- pred' declaration.
    foo.m:008:   However, a predicate of that name does exist with arity 1.
    foo.m:008: Inferred :- pred q1(int, string).
    foo.m:008:   The argument list difference from the arity 1 version is
    foo.m:008:     pred(
    foo.m:008:   -     int
    foo.m:008:   +     int,
    foo.m:008:   +     string
    foo.m:008:     )

Here the declaration and inferred types agree on the type of the first
argument, so there should be no change there.

Another possible issue: in these error message existentially quantified type
variables are displayed in the same way as universially quantified ones.

Julien.


More information about the reviews mailing list