X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcMatches.lhs;h=281921190fa24e5ebd965f7b1e4a3d9f4cd2c332;hb=19da321b73fb79535f72bf4abac69a3592f10e6d;hp=8df956d31ee3ee28ce83bc5cc190594dd86141d1;hpb=df68e45e1d7b934488be4d794f160ad5fac2a62c;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcMatches.lhs b/ghc/compiler/typecheck/TcMatches.lhs index 8df956d..2819211 100644 --- a/ghc/compiler/typecheck/TcMatches.lhs +++ b/ghc/compiler/typecheck/TcMatches.lhs @@ -31,7 +31,7 @@ import Inst ( tcSyntaxName, tcInstCall ) import TcEnv ( TcId, tcLookupLocalIds, tcLookupId, tcExtendIdEnv, tcExtendTyVarEnv ) import TcPat ( PatCtxt(..), tcPats ) -import TcMType ( newTyFlexiVarTy, newTyFlexiVarTys, zonkTcType, isRigidType ) +import TcMType ( newTyFlexiVarTy, newTyFlexiVarTys, zonkTcType ) import TcType ( TcType, TcTyVar, TcSigmaType, TcRhoType, mkFunTys, tyVarsOfTypes, tidyOpenTypes, isSigmaTy, mkTyConApp, liftedTypeKind, openTypeKind, mkArrowKind, mkAppTy ) @@ -282,16 +282,10 @@ tcMatchPats :: [LPat Name] -- signatures tcMatchPats pats tys body_ty thing_inside - = do { do_refinement <- can_refine body_ty - ; (pats', ex_tvs, res) <- tcPats (LamPat do_refinement) pats tys thing_inside + = do { (pats', ex_tvs, res) <- tcPats LamPat pats tys thing_inside ; tcCheckExistentialPat pats' ex_tvs tys body_ty ; returnM (pats', res) } where - -- Do GADT refinement if we are doing checking (not inference) - -- and the body_ty is completely rigid - -- ToDo: explain why - can_refine (Infer _) = return False - can_refine (Check ty) = isRigidType ty tcCheckExistentialPat :: [LPat TcId] -- Patterns (just for error message) -> [TcTyVar] -- Existentially quantified tyvars bound by pattern