Commit c88e1121 authored by Alan Zimmerman's avatar Alan Zimmerman Committed by Austin Seipp

Bring Match m_fun_id_infix through the renamer.

Summary:
This is a first step for #9988

It turns out that bringing m_fun_id_infix through the renamer is
actually very simple, affecting the internals of rnMatch' only.

Is this simple enough to hit 7.10.1?

Test Plan: ./validate

Reviewers: hvr, simonpj, austin

Reviewed By: simonpj, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D639

GHC Trac Issues: #9988
parent 78216e22
......@@ -978,7 +978,8 @@ rnMatch' :: Outputable (body RdrName) => HsMatchContext Name
-> (Located (body RdrName) -> RnM (Located (body Name), FreeVars))
-> Match RdrName (Located (body RdrName))
-> RnM (Match Name (Located (body Name)), FreeVars)
rnMatch' ctxt rnBody match@(Match _mf pats maybe_rhs_sig grhss)
rnMatch' ctxt rnBody match@(Match { m_fun_id_infix = mf, m_pats = pats
, m_type = maybe_rhs_sig, m_grhss = grhss })
= do { -- Result type signatures are no longer supported
case maybe_rhs_sig of
Nothing -> return ()
......@@ -988,8 +989,12 @@ rnMatch' ctxt rnBody match@(Match _mf pats maybe_rhs_sig grhss)
-- note that there are no local ficity decls for matches
; rnPats ctxt pats $ \ pats' -> do
{ (grhss', grhss_fvs) <- rnGRHSs ctxt rnBody grhss
; return (Match Nothing pats' Nothing grhss', grhss_fvs) }}
; let mf' = case (ctxt,mf) of
(FunRhs funid isinfix,Just (L lf _,_))
-> Just (L lf funid,isinfix)
_ -> Nothing
; return (Match { m_fun_id_infix = mf', m_pats = pats'
, m_type = Nothing, m_grhss = grhss'}, grhss_fvs ) }}
emptyCaseErr :: HsMatchContext Name -> SDoc
emptyCaseErr ctxt = hang (ptext (sLit "Empty list of alternatives in") <+> pp_ctxt)
......
(10,9,6)
(10,10,6)
(49,45,0)
(12,10,6)
(8,7,6)
(12,11,6)
(8,8,6)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment