Files
mercury/tests/invalid/wrong_arity_function.err_exp
Zoltan Somogyi 3a29391990 Improve error messages for wrong arity function calls.
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.
2016-06-22 13:29:28 +02:00

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'.