mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 09:23:44 +00:00
compiler/typecheck_error_undef.m:
When reporting an undefined name/arity pair, if the name happens
to be name of some functions and/or predicates which all have
different arities, add a sentence to the diagnostic to report this fact.
(Normally this happens only when the erroneous code provides
*too many* arguments, because if it does not, then the typechecker
would know that the code can be read as constructing a closure, and
would instead report errors for the arguments that have the wrong type.)
Don't color a closing parenthesis whose open parenthesis
is not colored.
Fix an old bug that we have no test case for: add the missing
initial part of the diagnostic for bugs that report undefined
*non*-user-defined function symbols. There shouldn't be any such
errors, but the types permit it ...
tests/invalid/wrong_arity_function.{m,err_exp}:
Extend this test case to test diagnostic extension described above.
tests/invalid/coerce_syntax.err_exp:
Expect the color change.
945 B
945 B
coerce_syntax.m:024: In clause for predicate `module_qualify_coerce'/0:
coerce_syntax.m:024: error: undefined symbol `coerce_syntax.coerce'/1.
coerce_syntax.m:029: In clause for predicate `apply_coerce'/0:
coerce_syntax.m:029: in argument 1 of functor `apply/2':
coerce_syntax.m:029: error: undefined symbol `coerce'/0.
coerce_syntax.m:029: (The builtin coerce operator expects one argument, not
coerce_syntax.m:029: zero.)
coerce_syntax.m:034: In clause for predicate `empty_apply_coerce'/0:
coerce_syntax.m:034: in argument 1 of functor `/2':
coerce_syntax.m:034: error: undefined symbol `coerce'/0.
coerce_syntax.m:034: (The builtin coerce operator expects one argument, not
coerce_syntax.m:034: zero.)
coerce_syntax.m:024: error: undefined symbol `coerce_syntax.coerce'/1.
coerce_syntax.m:029: In clause for predicate `apply_coerce'/0:
coerce_syntax.m:029: in argument 1 of functor `apply/2':
coerce_syntax.m:029: error: undefined symbol `coerce'/0.
coerce_syntax.m:029: (The builtin coerce operator expects one argument, not
coerce_syntax.m:029: zero.)
coerce_syntax.m:034: In clause for predicate `empty_apply_coerce'/0:
coerce_syntax.m:034: in argument 1 of functor `/2':
coerce_syntax.m:034: error: undefined symbol `coerce'/0.
coerce_syntax.m:034: (The builtin coerce operator expects one argument, not
coerce_syntax.m:034: zero.)