summaryrefslogtreecommitdiff
path: root/compiler/GHC/Rename/Expr.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2021-01-18 15:38:09 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-01-29 23:09:58 -0500
commit3b8235334b7838013c9e955db3e7762a1c7fef43 (patch)
treebb601c302ad43b60552bdc775b4ccb592d357e71 /compiler/GHC/Rename/Expr.hs
parent5140841ca1acaeaeef893233ae3d08ce4573b01b (diff)
downloadhaskell-3b8235334b7838013c9e955db3e7762a1c7fef43.tar.gz
Make PatSyn immutable
Provoked by #19074, this patch makes GHC.Core.PatSyn.PatSyn immutable, by recording only the *Name* of the matcher and builder rather than (as currently) the *Id*. See Note [Keep Ids out of PatSyn] in GHC.Core.PatSyn. Updates haddock submodule.
Diffstat (limited to 'compiler/GHC/Rename/Expr.hs')
-rw-r--r--compiler/GHC/Rename/Expr.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Rename/Expr.hs b/compiler/GHC/Rename/Expr.hs
index 191349a3b6..ab5330cce6 100644
--- a/compiler/GHC/Rename/Expr.hs
+++ b/compiler/GHC/Rename/Expr.hs
@@ -294,14 +294,14 @@ rnExpr (ExplicitSum x alt arity expr)
= do { (expr', fvs) <- rnLExpr expr
; return (ExplicitSum x alt arity expr', fvs) }
-rnExpr (RecordCon { rcon_con_name = con_id
+rnExpr (RecordCon { rcon_con = con_id
, rcon_flds = rec_binds@(HsRecFields { rec_dotdot = dd }) })
= do { con_lname@(L _ con_name) <- lookupLocatedOccRn con_id
; (flds, fvs) <- rnHsRecFields (HsRecFieldCon con_name) mk_hs_var rec_binds
; (flds', fvss) <- mapAndUnzipM rn_field flds
; let rec_binds' = HsRecFields { rec_flds = flds', rec_dotdot = dd }
; return (RecordCon { rcon_ext = noExtField
- , rcon_con_name = con_lname, rcon_flds = rec_binds' }
+ , rcon_con = con_lname, rcon_flds = rec_binds' }
, fvs `plusFV` plusFVs fvss `addOneFV` con_name) }
where
mk_hs_var l n = HsVar noExtField (L l n)