Wed Nov 21 06:33:46 PST 2007 [EMAIL PROTECTED] * MERGE: Zonk quantified tyvars with skolems + Rejig the error messages a bit; fixes a minor bug This merges to the 6.8 branch two HEAD patches (names above). The former "Zonk..." was for some reason partly in the branch already, which is what led to the complications. Here are the original patches: Fri Oct 19 12:56:53 BST 2007 Manuel M T Chakravarty <[EMAIL PROTECTED]> * Zonk quantified tyvars with skolems We used to zonk quantified type variables to regular TyVars. However, this leads to problems. Consider this program from the regression test suite: eval :: Int -> String -> String -> String eval 0 root actual = evalRHS 0 root actual evalRHS :: Int -> a evalRHS 0 root actual = eval 0 root actual It leads to the deferral of an equality (String -> String -> String) ~ a which is propagated up to the toplevel (see TcSimplify.tcSimplifyInferCheck). In the meantime `a' is zonked and quantified to form `evalRHS's signature. This has the *side effect* of also zonking the `a' in the deferred equality (which at this point is being handed around wrapped in an implication constraint). Finally, the equality (with the zonked `a') will be handed back to the simplifier by TcRnDriver.tcRnSrcDecls calling TcSimplify.tcSimplifyTop. If we zonk `a' with a regular type variable, we will have this regular type variable now floating around in the simplifier, which in many places assumes to only see proper TcTyVars. We can avoid this problem by zonking with a skolem. The skolem is rigid (which we requirefor a quantified variable), but is still a TcTyVar that the simplifier knows how to deal with. Thu Nov 1 17:50:22 GMT 2007 [EMAIL PROTECTED] * Rejig the error messages a bit; fixes a minor bug The type checker was only reporting the first message if an equality failed to match. This patch does a bit of refactoring and fixes the bug, which was in the bogus use of eqInstMisMatch in tcSimplify.report_no_instances.b This is really a bug in 6.8 too, so this would be good to merge across to the 6.8 branch.
M ./compiler/typecheck/Inst.lhs -5 +3 M ./compiler/typecheck/TcSimplify.lhs -6 +8 M ./compiler/typecheck/TcTyFuns.lhs -38 +43 M ./compiler/typecheck/TcUnify.lhs -8 +7 _______________________________________________ Cvs-ghc mailing list Cvs-ghc@haskell.org http://www.haskell.org/mailman/listinfo/cvs-ghc