Check for unused type variables in type instances is buggy for associated type defaults
Currently, a program like
type family F type instance forall a. F = ()
will give rise to an error
* Type variable `a' is bound by a forall, but not used in the family instance. * In the type instance declaration for `F'
Associated type defaults go through the same logic (
checkValidTyFamEqn which calls
checkFamPatBinders), but I think it is passed incorrect arguments, which means that the following program:
class C where type H type forall c. H = ()
does not give rise to any errors, when we would expect a similar error as above.
I will fix as part of my investigations into #23734 (closed).