mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 09:23:44 +00:00
compiler/typecheck_error_undef.m:
When users try to use arithmetic operations, bitwise operations,
or comparisons (meaning functions such as '+' or '<<', or predicates
such as '<') without importing any of the modules that define those ops,
generate a diagnostic that explains this specific situation. Mercury
is unusual in requiring such imports, so novices need to have this
pointed out to them. Have these messages replace the less-specific
messages we used to generate in such situations.
Fix a persistent typo.
tests/invalid/int_ops.{m,err_exp}:
A new test case for the new diagnostics.
tests/invalid/Mmakefile:
Enable the new test case.
tests/invalid/multiply_star.err_exp:
Expect the diagnostic text, and stop expecting the "did you mean"
message that it replaces.
tests/invalid/multiply_star.err_exp[23]:
Delete these files. They existed only because different sets of imports
with different options yielded different "did you mean" suggestions,
and we don't have those anymore.
tests/invalid/multiply_star.m:
Update the descriptions of the deleted .err_exp[23] files.
831 B
831 B
multiply_star.m:031: In clause for predicate `p'/2:
multiply_star.m:031: error: undefined symbol `*'/2.
multiply_star.m:031: In Mercury, if you want to invoke an arithmetic
multiply_star.m:031: operation such as `*', then you must import a module
multiply_star.m:031: that exports that operation. The modules in the Mercury
multiply_star.m:031: standard library that do so include `int', `uint', their
multiply_star.m:031: sized versions (such as `int8' and `uint16'), as well as
multiply_star.m:031: `integer' and `float'. However, none of those modules
multiply_star.m:031: have `:- import_module' declarations.
multiply_star.m:031: error: undefined symbol `*'/2.
multiply_star.m:031: In Mercury, if you want to invoke an arithmetic
multiply_star.m:031: operation such as `*', then you must import a module
multiply_star.m:031: that exports that operation. The modules in the Mercury
multiply_star.m:031: standard library that do so include `int', `uint', their
multiply_star.m:031: sized versions (such as `int8' and `uint16'), as well as
multiply_star.m:031: `integer' and `float'. However, none of those modules
multiply_star.m:031: have `:- import_module' declarations.