[m-rev.] for review: --warn-actually-ambiguous-pragmas

Peter Wang novalazy at gmail.com
Thu Jul 28 15:00:25 AEST 2022


On Wed, 27 Jul 2022 17:21:11 +1000 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> For review by Peter, since this diff implements his preferred semantics.
> 
> The change to the reference manual updates the documentation
> of only one pragma, inline, that does not allow the specification of modes,
> and one pragma, type_spec, that does allow them. After the review
> of the wording, I intend to make the same changes to the other pragmas
> that take name/arity pairs to specify a predicate or function.
> 
> Since repeating the text about what happens when a pragma does not
> have a pred(...) or func(...) wrapper around the name/arity will get boring
> quite fast, I also intend to factor out this text, including it just once in a new
> subsection, unless there is an objection.
> 
> Zoltan.

> Add --warn-actually-ambiguous-pragmas.
> 
> The new pragma generates a warning about pragmas that specify a name/arity
> pair that matches both a predicate and a function, but does not say which one
> it is intended to apply to.

We could call the option --warn-ambiguous-pragmas, no "actually".
I also think the warning can be enabled by default.

Moreover, I would be surprised if any real code relies on a single
pragma applying to both a predicate and function. It should be fine to
always report an error for an ambiguous pragma, and delete the option.
That could be done in a later change.

> tests/invalid_nodepend/fact_table_in_interface.err_exp:
>     Expext the updated wording of a warning.

Expect

That looks fine.

Peter


More information about the reviews mailing list