mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 09:53:36 +00:00
compiler/typecheck_errors.m:
When we find a reference to an unknown function symbol/arity pair
but the function symbol itself has definitions with other arities,
we want to print those arities to help programmers diagnose the problem.
When doing this, we used to take into account the arities only of the
data constructor function symbols of the same name; we now also take
into account the arities of the actual functions of the same name.
compiler/hlds_data.m:
Simplify the code for returning the list of the relevant arities
by not filtering out the actual (wrong) arity; this is now done
by the caller in typecheck.m for *both* sources of arities.
tests/invalid/wrong_arity_function.{m,err_exp}:
A test case for this fix.
tests/invalid/Mmakefile:
Enable the new test case.
4 lines
204 B
Plaintext
4 lines
204 B
Plaintext
wrong_arity_function.m:029: In clause for predicate `main'/2:
|
|
wrong_arity_function.m:029: error: wrong number of arguments (3; should be 1
|
|
wrong_arity_function.m:029: or 2) in use of constructor `f'.
|