[m-rev.] for review: extend "did you mean" messages to state var references

Julien Fischer jfischer at opturion.com
Thu Jan 29 00:38:43 AEDT 2026


On Wed, 28 Jan 2026 at 22:55, Zoltan Somogyi <zoltan.somogyi at runbox.com>
wrote:
> Include state var references in "did you mean" messages.
>
> compiler/make_hlds_warn.m:
>     When generating "did you mean" messages to add to warnings about
>     singleton variables, consider state variables in two separate ways.
>
>     - When figuring out what you could have meant with a singleton
reference
>       that is a variable such as PredInfo, consider that the intended
reference
>       *could* have been to a state variable (such as !.PredInfo).
>
>     - When figuring out what you could have meant with a singleton
reference
>       that is a state variable reference as !.PredIfno or !:PredIfno,
consider
>       that the intended reference *could* have been to another state
variable
>       (such as !.PredInfo or !:PredInfo).
>
>     Stop passing around a parameter that, for some predicates, was
*always*
>     set to the same value.
>
> tests/invalid/undef_symbol.{m,err_exp}:
>     Extend this test case with code that (except for the types)
>     duplicates the motivating example for this change.
>
> tests/invalid/bug278.err_exp:
> tests/invalid/field_syntax_error.err_exp:
>     Expect the extra dym messages that we now generate.

That's fine.

Julien.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20260129/24accbc6/attachment.html>


More information about the reviews mailing list