X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcSimplify.lhs;h=4cb32b8a0fbf5cf367daf8dd4f3cb1f326ea074e;hb=e1231b2bcb1c9294c2ecdf150e9aad72a0caa253;hp=19557c6dd7e21e2268a05219aa18b0ab250a80b4;hpb=5a8a219c131b56c75dbb3110da3ab5ae3715ff66;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcSimplify.lhs b/compiler/typecheck/TcSimplify.lhs index 19557c6..4cb32b8 100644 --- a/compiler/typecheck/TcSimplify.lhs +++ b/compiler/typecheck/TcSimplify.lhs @@ -42,8 +42,7 @@ import Inst ( lookupInst, LookupInstResult(..), import TcEnv ( tcGetGlobalTyVars, tcLookupId, findGlobals, pprBinders, lclEnvElts, tcMetaTy ) import InstEnv ( lookupInstEnv, classInstances, pprInstances ) -import TcMType ( zonkTcTyVarsAndFV, tcInstTyVars, zonkTcPredType, - checkAmbiguity, checkInstTermination ) +import TcMType ( zonkTcTyVarsAndFV, tcInstTyVars, zonkTcPredType ) import TcType ( TcTyVar, TcTyVarSet, ThetaType, TcPredType, tidyPred, mkClassPred, isOverloadedTy, mkTyConApp, isSkolemTyVar, mkTyVarTy, tcGetTyVar, isTyVarClassPred, mkTyVarTys, @@ -2283,19 +2282,10 @@ tcSimplifyDeriv tc tyvars theta rev_env = zipTopTvSubst tvs (mkTyVarTys tyvars) -- This reverse-mapping is a Royal Pain, -- but the result should mention TyVars not TcTyVars - - head_ty = TyConApp tc (map TyVarTy tvs) in addNoInstanceErrs Nothing [] bad_insts `thenM_` mapM_ (addErrTc . badDerivedPred) weird_preds `thenM_` - checkAmbiguity tvs simpl_theta tv_set `thenM_` - -- Check instance termination as for user-declared instances. - -- unless we had -fallow-undecidable-instances (which risks - -- non-termination in the 'deriving' context-inference fixpoint - -- loop). - ifM (gla_exts && not undecidable_ok) - (checkInstTermination simpl_theta [head_ty]) `thenM_` returnM (substTheta rev_env simpl_theta) where doc = ptext SLIT("deriving classes for a data type")