[m-rev.] for review: improve instance diagostics
Julien Fischer
jfischer at opturion.com
Thu Jun 28 03:16:46 AEST 2018
On Wed, 27 Jun 2018, Zoltan Somogyi wrote:
> For review by anyone. I hope this will help people to understand
> the messages for the problem reported yesterday on m-users.
> Improve diagnostics for bad instance declarations.
>
> compiler/check_typeclass.m:
> When a type is an instance declaration is not a type constructor,
> don't just say what it is; say also what it should be.
s/is an/in an/
> When a type is an instance declaration is a type constructor but some
Ditto
> 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.
That looks fine otherwise.
Julien.
More information about the reviews
mailing list