[project @ 2004-08-18 09:33:03 by simonpj]
-------------------------------
Fix a fundep bug
-------------------------------
MERGE TO STABLE
Big thank-you to Martin Sulzmann for finding this functional dependency bug.
The new defn of FunDeps.Equation is:
type Equation = (TyVarSet, [(Type, Type)])
Before it was (TyVarSet, Type, Type), so each pair of types was separately
quantified (wrong).
It's important that we have a *list* of pairs of types. Consider
class C a b c | a -> b c where ...
instance C Int x x where ...
Then, given the constraint (C Int Bool v) we should improve v to Bool,
via the equation ({x}, [(Bool,x), (v,x)])
This would not happen if the class had looked like
class C a b c | a -> b, a -> c
Test in typecheck/should_compile/tc180