X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcMatches.lhs;h=db695656af25834d83530327e0ba585a168f4358;hb=6288438bbe2e9988a6d633a47f1bc75ada15faf7;hp=58ddd037c45a93a1da3023c92476ba122745053a;hpb=380602804cb003cbe7253bc04e2c627616cce2d2;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcMatches.lhs b/ghc/compiler/typecheck/TcMatches.lhs index 58ddd03..db69565 100644 --- a/ghc/compiler/typecheck/TcMatches.lhs +++ b/ghc/compiler/typecheck/TcMatches.lhs @@ -18,10 +18,10 @@ import RnHsSyn ( RenamedMatch, RenamedGRHSs, RenamedStmt ) import TcHsSyn ( TcMatch, TcGRHSs, TcStmt ) import TcMonad -import TcMonoType ( checkSigTyVars, tcHsTyVar, tcHsType, noSigs, sigPatCtxt ) +import TcMonoType ( checkSigTyVars, tcHsTyVar, tcHsType, sigPatCtxt ) import Inst ( Inst, LIE, plusLIE, emptyLIE, plusLIEs ) import TcEnv ( tcExtendLocalValEnv, tcExtendGlobalTyVars, tcExtendTyVarEnv ) -import TcPat ( tcPat, polyPatSig ) +import TcPat ( tcPat, tcPatBndr_NoSigs, polyPatSig ) import TcType ( TcType, newTyVarTy, newTyVarTy_OpenKind ) import TcBinds ( tcBindsAndThen ) import TcSimplify ( tcSimplifyAndCheck, bindInstsOfLocalFuns ) @@ -243,9 +243,9 @@ tcMatchPats [] expected_ty = returnTc (expected_ty, [], emptyLIE, emptyBag, emptyBag, emptyLIE) tcMatchPats (pat:pats) expected_ty - = unifyFunTy expected_ty `thenTc` \ (arg_ty, rest_ty) -> - tcPat noSigs pat arg_ty `thenTc` \ (pat', lie_req, pat_tvs, pat_ids, lie_avail) -> - tcMatchPats pats rest_ty `thenTc` \ (rhs_ty, pats', lie_reqs, pats_tvs, pats_ids, lie_avails) -> + = unifyFunTy expected_ty `thenTc` \ (arg_ty, rest_ty) -> + tcPat tcPatBndr_NoSigs pat arg_ty `thenTc` \ (pat', lie_req, pat_tvs, pat_ids, lie_avail) -> + tcMatchPats pats rest_ty `thenTc` \ (rhs_ty, pats', lie_reqs, pats_tvs, pats_ids, lie_avails) -> returnTc ( rhs_ty, pat':pats', lie_req `plusLIE` lie_reqs, @@ -309,7 +309,7 @@ tcStmts do_or_lc m (stmt@(BindStmt pat exp src_loc) : stmts) elt_ty = tcAddSrcLoc src_loc ( tcSetErrCtxt (stmtCtxt do_or_lc stmt) $ newTyVarTy boxedTypeKind `thenNF_Tc` \ pat_ty -> - tcPat noSigs pat pat_ty `thenTc` \ (pat', pat_lie, pat_tvs, pat_ids, avail) -> + tcPat tcPatBndr_NoSigs pat pat_ty `thenTc` \ (pat', pat_lie, pat_tvs, pat_ids, avail) -> tcExpr exp (m pat_ty) `thenTc` \ (exp', exp_lie) -> returnTc (pat', exp', pat_lie `plusLIE` exp_lie, @@ -378,7 +378,7 @@ sameNoOfArgs matches = length (nub (map args_in_match matches)) == 1 \begin{code} matchCtxt CaseAlt match - = hang (ptext SLIT("In a \"case\" branch:")) + = hang (ptext SLIT("In a case alternative:")) 4 (pprMatch (True,empty) {-is_case-} match) matchCtxt (FunRhs fun) match