X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Frename%2FRnBinds.lhs;h=db0e9a3b3381a1389907419da21c648eb0e32cfc;hb=92e1151179b419ce5d7a144993053ae982e0df5e;hp=ff0629ac688b1742d4e74edf84523660b317611c;hpb=7d52c74cab50d3c9a5e76be5b97d63b60069bc2e;p=ghc-hetmet.git diff --git a/compiler/rename/RnBinds.lhs b/compiler/rename/RnBinds.lhs index ff0629a..db0e9a3 100644 --- a/compiler/rename/RnBinds.lhs +++ b/compiler/rename/RnBinds.lhs @@ -9,6 +9,13 @@ type-synonym declarations; those cannot be done at this stage because they may be affected by renaming (which isn't fully worked out yet). \begin{code} +{-# OPTIONS_GHC -w #-} +-- The above warning supression flag is a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings +-- for details + module RnBinds ( rnTopBinds, rnLocalBindsAndThen, rnValBindsAndThen, rnValBinds, trimWith, @@ -380,7 +387,7 @@ rnBind sig_fn trim (L loc (FunBind { fun_id = name, fun_infix = inf, fun_matches ; (matches', fvs) <- bindSigTyVarsFV (sig_fn plain_name) $ -- bindSigTyVars tests for Opt_ScopedTyVars - rnMatchGroup (FunRhs plain_name) matches + rnMatchGroup (FunRhs plain_name inf) matches ; checkPrecMatch inf plain_name matches' @@ -444,12 +451,12 @@ rnMethodBind cls sig_fn gen_tyvars (L loc (FunBind { fun_id = name, fun_infix = -- type variables. See comments in RnSource.rnSourceDecl(ClassDecl) rn_match sel_name match@(L _ (Match (L _ (TypePat ty) : _) _ _)) = extendTyVarEnvFVRn gen_tvs $ - rnMatch (FunRhs sel_name) match + rnMatch (FunRhs sel_name inf) match where tvs = map (rdrNameOcc.unLoc) (extractHsTyRdrTyVars ty) gen_tvs = [tv | tv <- gen_tyvars, nameOccName tv `elem` tvs] - rn_match sel_name match = rnMatch (FunRhs sel_name) match + rn_match sel_name match = rnMatch (FunRhs sel_name inf) match -- Can't handle method pattern-bindings which bind multiple methods. @@ -555,10 +562,10 @@ rnMatch' ctxt match@(Match pats maybe_rhs_sig grhss) = -- Deal with the rhs type signature bindPatSigTyVarsFV rhs_sig_tys $ - doptM Opt_GlasgowExts `thenM` \ opt_GlasgowExts -> + doptM Opt_PatternSignatures `thenM` \ opt_PatternSignatures -> (case maybe_rhs_sig of Nothing -> returnM (Nothing, emptyFVs) - Just ty | opt_GlasgowExts -> rnHsTypeFVs doc_sig ty `thenM` \ (ty', ty_fvs) -> + Just ty | opt_PatternSignatures -> rnHsTypeFVs doc_sig ty `thenM` \ (ty', ty_fvs) -> returnM (Just ty', ty_fvs) | otherwise -> addLocErr ty patSigErr `thenM_` returnM (Nothing, emptyFVs)