Files
mercury/tests/invalid/bug278.err_exp
Zoltan Somogyi 44a0c62d96 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.
2026-01-29 01:20:54 +11:00

688 B

bug278.m:032: In clause for `build_map((pred(in, out, in, out) is semidet), in,
bug278.m:032: out, in, out)':
bug278.m:032: mode error: argument 3 did not get sufficiently instantiated.
bug278.m:032: Final instantiatedness of `LambdaHeadVar__5' was `free',
bug278.m:032: expected final instantiatedness was `ground'.
bug278.m:032: In clause for predicate `build_map'/5:
bug278.m:032: warning: variable `STATE_VARIABLE_MemoTable' occurs only once
bug278.m:032: in this scope.
bug278.m:032: (Did you mean `!.MemoTable1'?)
For more information, recompile with `-E'.