aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Convert.hs
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2021-02-22 20:04:24 +0000
committerAlan Zimmerman <alan.zimm@gmail.com>2021-02-22 20:04:24 +0000
commit8241d9e700e043b86b609c334494c4632848389f (patch)
tree58cc739b2a3f9aa70c344a8c98994bd6c8b03172 /haddock-api/src/Haddock/Convert.hs
parentd1b7f181b60ba3ac191183f1512e66793d28ac08 (diff)
Context becomes a Maybe in the GHC AST
This prevents noLoc's appearing in the ParsedSource. Match the change in GHC.
Diffstat (limited to 'haddock-api/src/Haddock/Convert.hs')
-rw-r--r--haddock-api/src/Haddock/Convert.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs
index 10e13152..83711414 100644
--- a/haddock-api/src/Haddock/Convert.hs
+++ b/haddock-api/src/Haddock/Convert.hs
@@ -215,7 +215,7 @@ synifyTyCon prr _coax tc
, tcdDataDefn = HsDataDefn { dd_ext = noExtField
, dd_ND = DataType -- arbitrary lie, they are neither
-- algebraic data nor newtype:
- , dd_ctxt = noLoc []
+ , dd_ctxt = Nothing
, dd_cType = Nothing
, dd_kindSig = synifyDataTyConReturnKind tc
-- we have their kind accurately:
@@ -377,7 +377,7 @@ synifyDataCon use_gadt_syntax dc =
-- skip any EqTheta, use 'orig'inal syntax
ctx | null theta = Nothing
- | otherwise = Just $ synifyCtx theta
+ | otherwise = synifyCtx theta
linear_tys =
zipWith (\ty bang ->
@@ -461,8 +461,8 @@ synifyTcIdSig vs (i, dm) =
mainSig t = synifySigType DeleteTopLevelQuantification vs t
defSig t = synifySigType ImplicitizeForAll vs t
-synifyCtx :: [PredType] -> LHsContext GhcRn
-synifyCtx = noLoc . map (synifyType WithinType [])
+synifyCtx :: [PredType] -> Maybe (LHsContext GhcRn)
+synifyCtx ts = Just (noLoc ( map (synifyType WithinType []) ts))
synifyTyVars :: [TyVar] -> LHsQTyVars GhcRn