summaryrefslogtreecommitdiff
path: root/compiler/hsSyn
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2015-11-07 23:46:03 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2015-11-07 23:46:41 +0000
commit22080113f02f6644e2a0e3ce8adb1502346ab3b4 (patch)
tree34b6f17711855e9ddf93c13b6f06840e2b0915b9 /compiler/hsSyn
parentbe8858570274821546ccabf75fe01c3dad80e337 (diff)
downloadhaskell-22080113f02f6644e2a0e3ce8adb1502346ab3b4.tar.gz
Remove PatSynBuilderId
Summary: It was only used to pass field labels between the typechecker and desugarer. Instead we add an extra field the RecordCon to carry this information. Reviewers: austin, goldfire, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1443 GHC Trac Issues: #11057
Diffstat (limited to 'compiler/hsSyn')
-rw-r--r--compiler/hsSyn/Convert.hs4
-rw-r--r--compiler/hsSyn/HsExpr.hs4
-rw-r--r--compiler/hsSyn/PlaceHolder.hs2
3 files changed, 8 insertions, 2 deletions
diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs
index deabf37d5b..28b699d3fd 100644
--- a/compiler/hsSyn/Convert.hs
+++ b/compiler/hsSyn/Convert.hs
@@ -711,7 +711,9 @@ cvtl e = wrapL (cvt e)
; return $ ExprWithTySig e' t' PlaceHolder }
cvt (RecConE c flds) = do { c' <- cNameL c
; flds' <- mapM (cvtFld mkFieldOcc) flds
- ; return $ RecordCon c' noPostTcExpr (HsRecFields flds' Nothing)}
+ ; return $ RecordCon c' noPostTcExpr
+ (HsRecFields flds' Nothing)
+ PlaceHolder }
cvt (RecUpdE e flds) = do { e' <- cvtl e
; flds'<- mapM (cvtFld mkAmbiguousFieldOcc) flds
; return $ RecordUpd e'
diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs
index 84264b448f..5ee17cff9b 100644
--- a/compiler/hsSyn/HsExpr.hs
+++ b/compiler/hsSyn/HsExpr.hs
@@ -36,6 +36,7 @@ import StaticFlags( opt_PprStyle_Debug )
import Outputable
import FastString
import Type
+import FieldLabel
-- libraries:
import Data.Data hiding (Fixity)
@@ -284,6 +285,7 @@ data HsExpr id
-- it's the dataConWrapId of the constructor
PostTcExpr -- Data con Id applied to type args
(HsRecordBinds id)
+ (PostTc id [FieldLabel])
-- | Record update
--
@@ -727,7 +729,7 @@ ppr_expr (ExplicitList _ _ exprs)
ppr_expr (ExplicitPArr _ exprs)
= paBrackets (pprDeeperList fsep (punctuate comma (map ppr_lexpr exprs)))
-ppr_expr (RecordCon con_id _ rbinds)
+ppr_expr (RecordCon con_id _ rbinds _)
= hang (ppr con_id) 2 (ppr rbinds)
ppr_expr (RecordUpd aexp rbinds _ _ _ _)
diff --git a/compiler/hsSyn/PlaceHolder.hs b/compiler/hsSyn/PlaceHolder.hs
index ed44d2c73f..b37cd357d2 100644
--- a/compiler/hsSyn/PlaceHolder.hs
+++ b/compiler/hsSyn/PlaceHolder.hs
@@ -16,6 +16,7 @@ import Var
import Coercion
import {-# SOURCE #-} ConLike (ConLike)
import TcEvidence (HsWrapper)
+import FieldLabel
import Data.Data hiding ( Fixity )
import BasicTypes (Fixity)
@@ -111,4 +112,5 @@ type DataId id =
, Data (PostTc id [Type])
, Data (PostTc id [ConLike])
, Data (PostTc id HsWrapper)
+ , Data (PostTc id [FieldLabel])
)