Superclass cycle with ambiguous type causes loop
If I say
class D a => C a where meth :: D a => () class C a => D a
I get a loop in the typechecker.
I know what's going on here: the error for the superclass cycle is added during the validity check, but then we go on to do ambiguity checks. Unfortunately, the ambiguity check never finishes. We just need to bail when there are superclass errors before doing the ambiguity check.
Patch on the way.