mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-18 02:43:40 +00:00
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.
27 lines
1.8 KiB
Plaintext
27 lines
1.8 KiB
Plaintext
invalid_instance_declarations.m:017: In instance declaration for `tc(((func) =
|
|
invalid_instance_declarations.m:017: T), int)':
|
|
invalid_instance_declarations.m:017: the first instance type `((func) = T)'
|
|
invalid_instance_declarations.m:017: is a higher order type; it should be a
|
|
invalid_instance_declarations.m:017: type constructor applied to zero or more
|
|
invalid_instance_declarations.m:017: type variables.
|
|
invalid_instance_declarations.m:018: In instance declaration for `tc(t(int),
|
|
invalid_instance_declarations.m:018: int)':
|
|
invalid_instance_declarations.m:018: in the first instance type, one of the
|
|
invalid_instance_declarations.m:018: arguments of the type constructor `t'/1
|
|
invalid_instance_declarations.m:018: is not a type variable, but should be.
|
|
invalid_instance_declarations.m:018: This is the first argument, `int'.
|
|
invalid_instance_declarations.m:019: In instance declaration for `tc(t(int),
|
|
invalid_instance_declarations.m:019: t(int, string))':
|
|
invalid_instance_declarations.m:019: in the first instance type, one of the
|
|
invalid_instance_declarations.m:019: arguments of the type constructor `t'/1
|
|
invalid_instance_declarations.m:019: is not a type variable, but should be.
|
|
invalid_instance_declarations.m:019: This is the first argument, `int'.
|
|
invalid_instance_declarations.m:019: In instance declaration for `tc(t(int),
|
|
invalid_instance_declarations.m:019: t(int, string))':
|
|
invalid_instance_declarations.m:019: in the second instance type, some of the
|
|
invalid_instance_declarations.m:019: arguments of the type constructor `t'/2
|
|
invalid_instance_declarations.m:019: are not type variables, but should be.
|
|
invalid_instance_declarations.m:019: These are the first argument, `int' and
|
|
invalid_instance_declarations.m:019: the second argument, `string'.
|
|
For more information, recompile with `-E'.
|