[m-rev.] for post-commit review: report bad typeclass constraints

Peter Wang novalazy at gmail.com
Mon Nov 9 12:32:06 AEDT 2020


On Sat, 07 Nov 2020 11:28:24 +1100 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> Report references to nonexistent typeclasses.
> 
> compiler/check_typeclass.m:
>     Look for typeclass constraints on predicates and data constructors
>     that refer to nonexistent typeclasses. We already report such references
>     when they occur in the module being compiled, but not when they occur
>     in declarations imported from other modules.
> 
>     Before this diff, the compiler used to abort with a failed map.lookup
>     when this occurred. With this diff, the compiler prints a diagnostic
>     and exits normally.
> 
>     Give some predicates more meaningful names. Update an accumulator
>     using a predicate, not a function. Exploit capabilities in error_util.m
>     that did not exist when this module first started to use it.
>     Use set operations instead of solutions to compute an intersection.
>     Avoid repeated string copying. Fix indentation.
> 

That looks fine.

Peter


More information about the reviews mailing list