mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-25 14:24:11 +00:00
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.
11 lines
688 B
Plaintext
11 lines
688 B
Plaintext
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 [38;5;87m`LambdaHeadVar__5'[39;49m was [38;5;203m`free',[39;49m
|
||
bug278.m:032: expected final instantiatedness was [38;5;40m`ground'.[39;49m
|
||
bug278.m:032: In clause for predicate `build_map'/5:
|
||
bug278.m:032: warning: variable [38;5;87m`STATE_VARIABLE_MemoTable'[39;49m [38;5;203moccurs only once[39;49m
|
||
bug278.m:032: in this scope.
|
||
bug278.m:032: [38;5;226m(Did you mean `!.MemoTable1'?)[39;49m
|
||
For more information, recompile with `-E'.
|