diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2017-05-08 17:47:19 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-05-08 22:26:41 -0400 |
commit | 372995364c52eef15066132d7d1ea8b6760034e6 (patch) | |
tree | 1b5d39684c0fe65636a43ff67405615abd2ea8c6 /compiler/rename/RnBinds.hs | |
parent | b99bae6d132e083b73283963be85932596341ddd (diff) | |
download | haskell-372995364c52eef15066132d7d1ea8b6760034e6.tar.gz |
Treat banged bindings as FunBinds
This reworks the HsSyn representation to make banged variable patterns
(e.g. !x = e) be represented as FunBinds instead of PatBinds, adding a flag to
FunRhs to record the bang.
Fixes #13594.
Reviewers: austin, goldfire, alanz, simonpj
Reviewed By: simonpj
Subscribers: simonpj, rwbarton, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D3525
Diffstat (limited to 'compiler/rename/RnBinds.hs')
-rw-r--r-- | compiler/rename/RnBinds.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rename/RnBinds.hs b/compiler/rename/RnBinds.hs index 9abeee207e..d78ed93d2e 100644 --- a/compiler/rename/RnBinds.hs +++ b/compiler/rename/RnBinds.hs @@ -482,7 +482,7 @@ rnBind sig_fn bind@(FunBind { fun_id = name ; (matches', rhs_fvs) <- bindSigTyVarsFV (sig_fn plain_name) $ -- bindSigTyVars tests for LangExt.ScopedTyVars - rnMatchGroup (FunRhs name Prefix) + rnMatchGroup (mkPrefixFunRhs name) rnLExpr matches ; let is_infix = isInfixFunBind bind ; when is_infix $ checkPrecMatch plain_name matches' @@ -667,7 +667,7 @@ rnPatSynBind sig_fn bind@(PSB { psb_id = L l name ImplicitBidirectional -> return (ImplicitBidirectional, emptyFVs) ExplicitBidirectional mg -> do { (mg', fvs) <- bindSigTyVarsFV sig_tvs $ - rnMatchGroup (FunRhs (L l name) Prefix) + rnMatchGroup (mkPrefixFunRhs (L l name)) rnLExpr mg ; return (ExplicitBidirectional mg', fvs) } @@ -1148,8 +1148,8 @@ rnMatch' ctxt rnBody match@(Match { m_ctxt = mf, m_pats = pats ; rnPats ctxt pats $ \ pats' -> do { (grhss', grhss_fvs) <- rnGRHSs ctxt rnBody grhss ; let mf' = case (ctxt,mf) of - (FunRhs (L _ funid) _,FunRhs (L lf _) _) - -> FunRhs (L lf funid) fixity + (FunRhs (L _ funid) _ _,FunRhs (L lf _) _ _) + -> FunRhs (L lf funid) fixity NoSrcStrict -- TODO: Is this right? _ -> ctxt ; return (Match { m_ctxt = mf', m_pats = pats' , m_type = Nothing, m_grhss = grhss'}, grhss_fvs ) }} |