Regression in interaction between type families and equality constraints
I've encountered a regression in GHC 9.2.2 where a flexible instance requiring
R ~ e ': some_tail fails to apply even when given the context
R ~ e ': F R, where
R are type families. However, adding the seemingly redundant constraint
r ~ R -- where
r is an otherwise completely unused polymorphic type variable -- allows the instance to be deduced.
Steps to reproduce
Minimal reproducer. The
errors function is rejected with:
• Could not deduce (Foo Int R) arising from a use of ‘Dict’ from the context: R ~ (Int : F R)
Reproducer tested on GHC 9.2.2 and errors. Compiles without issue on GHC 9.0.2.