Files
mercury/tests/invalid/bad_instance2.err_exp
Zoltan Somogyi f1745bba2d Systematize error reporting in check_typeclass.m.
compiler/check_typeclass.m:
    As above. This makes future changes to the main code of the module easier.
    In some cases, this required carving error message generating code
    out of larger predicates.

    Some errors were being generated by functions that returned an error_spec,
    and others by predicates that added the new error_spec to !Specs.
    Standardize on the latter scheme.

    Use some recently-added auxiliary functions to generate parts of some
    error messages, to present the same info the same way in different
    error messages. This part of the diff causes the changes to .err_exp files
    below.

    Start the name of all the predicates that generate error with "report_".

    Return !:Specs. Do not take an an initial !.Specs argument, because
    any error_specs in it would screw up a test. Our caller always passed us
    [] anyway.

    The non-error-reporting code in this module is (currently) divided into
    six passes. The code that checks for cycles between typeclasses is the
    third pass, but its code was after the code of the fourth pass; fix that.

    Turn some functions into predicates to allow the use of state variables.

    Rename a function symbol to avoid an ambiguity.

    Fix comment rot.

compiler/mercury_compile_front_end.m:
    Don't pass [] as the initial !.Specs.

compiler/hlds_class.m:
    Move a type definition to its proper place.

tests/invalid/bad_instance2.err_exp:
tests/invalid/constraint_proof_bug_lib.err_exp:
tests/invalid/invalid_instance_declarations.err_exp:
    Expect updated error messages.
2022-11-24 10:05:06 +11:00

10 lines
557 B
Plaintext

bad_instance2.m:012: In instance declaration for `foo(bar(T), U)':
bad_instance2.m:012: the second instance type `U' is a type variable; it
bad_instance2.m:012: should be a type constructor applied to zero or more
bad_instance2.m:012: type variables.
bad_instance2.m:016: In instance declaration for `foo(bar(T), T)':
bad_instance2.m:016: the second instance type `T' is a type variable; it
bad_instance2.m:016: should be a type constructor applied to zero or more
bad_instance2.m:016: type variables.
For more information, recompile with `-E'.