-rnMatch' ctxt (Match pats maybe_rhs_sig grhss)
- =
- -- Deal with the rhs type signature
- bindPatSigTyVarsFV rhs_sig_tys $ do
- opt_PatternSignatures <- doptM Opt_PatternSignatures
- (maybe_rhs_sig', ty_fvs) <-
- case maybe_rhs_sig of
- Nothing -> return (Nothing, emptyFVs)
- Just ty | opt_PatternSignatures -> do (ty', ty_fvs) <- rnHsTypeFVs doc_sig ty
- return (Just ty', ty_fvs)
- | otherwise -> do addLocErr ty patSigErr
- return (Nothing, emptyFVs)
-
- -- Now the main event
- -- note that there are no local ficity decls for matches
- rnPatsAndThen_LocalRightwards ctxt pats $ \ pats' -> do
- (grhss', grhss_fvs) <- rnGRHSs ctxt grhss
-
- return (Match pats' maybe_rhs_sig' grhss', grhss_fvs `plusFV` ty_fvs)
+rnMatch' ctxt match@(Match pats maybe_rhs_sig grhss)
+ = do { -- Result type signatures are no longer supported
+ case maybe_rhs_sig of
+ Nothing -> return ()
+ Just ty -> addLocErr ty (resSigErr ctxt match)
+
+
+ -- Now the main event
+ -- note that there are no local ficity decls for matches
+ ; rnPatsAndThen_LocalRightwards ctxt pats $ \ pats' -> do
+ { (grhss', grhss_fvs) <- rnGRHSs ctxt grhss
+
+ ; return (Match pats' Nothing grhss', grhss_fvs) }}