Note [Superclasses and satisfiability]
Expand superclasses before starting, because (Int ~ Bool), has (Int ~~ Bool) as a superclass, which in turn has (Int ~N# Bool) as a superclass, and it's the latter that is insoluble. See Note [The equality types story] in GHC.Builtin.Types.Prim. If we fail to prove unsatisfiability we (arbitrarily) try just once to find superclasses, using try_harder. Reason: we might have a type signature f :: F op (Implements push) => .. where F is a type function. This happened in #3972. We could do more than once but we'd have to have /some/ limit: in the the recursive case, we would go on forever in the common case where the constraints /are/ satisfiable (#10592 comment:12!). For straightforward situations without type functions the try_harder step does nothing.
References 1
- The equality types story GHC.Builtin.Types.Prim
Referenced by 2
- GHC.Tc.Solver call site ×2