X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcMatches.lhs;h=27d1e9b3b68120c1ae2339935f5444deb97128f6;hp=07a1094d58de98b08937c346db5965a070bac90f;hb=5a552652286f9a019d37ded2428fb6543b169310;hpb=451d907d9db34b9f7c787af4196e0bec05916508 diff --git a/compiler/typecheck/TcMatches.lhs b/compiler/typecheck/TcMatches.lhs index 07a1094..27d1e9b 100644 --- a/compiler/typecheck/TcMatches.lhs +++ b/compiler/typecheck/TcMatches.lhs @@ -23,10 +23,8 @@ import HsSyn ( HsExpr(..), LHsExpr, MatchGroup(..), ExprCoFn ) import TcRnMonad -import TcHsType ( tcPatSig, UserTypeCtxt(..) ) import Inst ( newMethodFromName ) -import TcEnv ( TcId, tcLookupLocalIds, tcLookupId, tcExtendIdEnv, - tcExtendTyVarEnv2 ) +import TcEnv ( TcId, tcLookupLocalIds, tcLookupId, tcExtendIdEnv ) import TcPat ( PatCtxt(..), tcPats, tcPat ) import TcMType ( newFlexiTyVarTy, newFlexiTyVarTys ) import TcType ( TcType, TcRhoType, @@ -165,15 +163,16 @@ tcMatch ctxt pat_tys rhs_ty match = addErrCtxt (matchCtxt (mc_what ctxt) match) $ do { (pats', grhss') <- tcPats LamPat pats pat_tys rhs_ty $ tc_grhss ctxt maybe_rhs_sig grhss - ; returnM (Match pats' Nothing grhss') } + ; return (Match pats' Nothing grhss') } tc_grhss ctxt Nothing grhss rhs_ty = tcGRHSs ctxt grhss rhs_ty -- No result signature + -- Result type sigs are no longer supported tc_grhss ctxt (Just res_sig) grhss rhs_ty - = do { (inner_ty, sig_tvs) <- tcPatSig ResSigCtxt res_sig rhs_ty - ; tcExtendTyVarEnv2 sig_tvs $ - tcGRHSs ctxt grhss inner_ty } + = do { addErr (ptext SLIT("Ignoring (deprecated) result type signature") + <+> ppr res_sig) + ; tcGRHSs ctxt grhss rhs_ty } ------------- tcGRHSs :: TcMatchCtxt -> GRHSs Name -> BoxyRhoType -> TcM (GRHSs TcId) @@ -500,6 +499,7 @@ checkArgs fun (MatchGroup (match1:matches) _) args_in_match :: LMatch Name -> Int args_in_match (L _ (Match pats _ _)) = length pats +checkArgs fun other = panic "TcPat.checkArgs" -- Matches always non-empty \end{code} \begin{code}