Fix Trac #3017: ensure that we quantify over enough type variables when equalities...
authorsimonpj@microsoft.com <unknown>
Wed, 11 Feb 2009 17:47:33 +0000 (17:47 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 11 Feb 2009 17:47:33 +0000 (17:47 +0000)
commite5a8d57c85d42007c8cc561e6d6b805c23603fc0
tree20fbf36c6f5ec00b239c536550c2992b2dffd342
parent902b277cd6ae9a37f84967cdec6335af4c29575e
Fix Trac #3017: ensure that we quantify over enough type variables when equalities are involved

The function FunDeps.grow was not doing the right thing when type equality
constraints were involved.  That wasn't really its fault: its input was
being filtered by fdPredsOfInsts.

To fix this I did a bit of refactoring, so that the (revolting) fdPredsOfInsts
is now less important (maybe we can get rid of it in due course).  The 'grow'
function moves from FunDeps to
 Inst.growInstsTyVars
 TcMTType.growThetaTyVars
 TcMType.growTyVars

The main comments are with the first of these, in
Note [Growing the tau-tvs using constraints] in Inst.

Push to the branch if conflict free.
compiler/basicTypes/VarSet.lhs
compiler/typecheck/Inst.lhs
compiler/typecheck/TcMType.lhs
compiler/typecheck/TcSimplify.lhs
compiler/typecheck/TcTyClsDecls.lhs
compiler/types/FunDeps.lhs