mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-18 10:53:40 +00:00
compiler/check_typeclass.m:
When a type in an instance declaration is not a type constructor,
don't just say what it is; say also what it should be.
When a type in an instance declaration is a type constructor but some
of its arguments are not type variables, don't just say so: say *which*
of their arguments are the problem.
Do not use "argument" to refer to both "the arguments of the instance
declaration" and the "arguments of a type constructor"; use the terminology
"instance type" for the former.
Always end the line after the ":" in the error's top level description.
Omit the module qualification of the typeclass name in error messages,
since the base name of the typeclass, and the context, should always
be enough to eliminate any ambiguity.
Fix a bug in the use of choose_number.
Don't gather the set of seen types, since it was never used.
tests/invalid/invalid_instance_declarations.m:
Extend this test to type classes with more than one type.
tests/invalid/bad_instance2.err_exp:
tests/invalid/constraint_proof_bug_lib.err_exp:
tests/invalid/fundeps_coverage.err_exp:
tests/invalid/instance_var_bug.err_exp:
tests/invalid/invalid_instance_declarations.err_exp:
tests/invalid/range_restrict.err_exp:
tests/invalid/tc_err1.err_exp:
tests/invalid/tc_err2.err_exp:
tests/invalid/typeclass_bogus_method.err_exp:
tests/invalid/typeclass_missing_mode_2.err_exp:
tests/invalid/typeclass_test_10.err_exp:
tests/invalid/typeclass_test_3.err_exp:
tests/invalid/typeclass_test_4.err_exp:
tests/invalid/typeclass_test_5.err_exp:
tests/invalid/typeclass_test_9.err_exp:
Update these expected outputs to account for the changes above.
32 lines
2.2 KiB
Plaintext
32 lines
2.2 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
|
|
invalid_instance_declarations.m:018: `tc(invalid_instance_declarations.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
|
|
invalid_instance_declarations.m:019: `tc(invalid_instance_declarations.t(int),
|
|
invalid_instance_declarations.m:019: invalid_instance_declarations.t(int,
|
|
invalid_instance_declarations.m:019: 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
|
|
invalid_instance_declarations.m:019: `tc(invalid_instance_declarations.t(int),
|
|
invalid_instance_declarations.m:019: invalid_instance_declarations.t(int,
|
|
invalid_instance_declarations.m:019: 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'.
|