aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Interface
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-api/src/Haddock/Interface')
-rw-r--r--haddock-api/src/Haddock/Interface/Create.hs3
-rw-r--r--haddock-api/src/Haddock/Interface/Rename.hs22
2 files changed, 18 insertions, 7 deletions
diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index 09eb2ad5..ee93324e 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -64,7 +64,6 @@ import GHC.Tc.Types hiding (IfM)
import GHC.Tc.Utils.Monad (finalSafeMode)
import GHC.Types.Avail hiding (avail)
import qualified GHC.Types.Avail as Avail
-import GHC.Types.Basic (PromotionFlag (..))
import GHC.Types.Name (getOccString, getSrcSpan, isDataConName, isValName, nameIsLocalOrFrom, nameOccName, emptyOccEnv)
import GHC.Types.Name.Env (lookupNameEnv)
import GHC.Types.Name.Reader (GlobalRdrEnv, greMangledName, lookupGlobalRdrEnv)
@@ -755,7 +754,7 @@ availExportItem is_sig modMap thisMod semMod warnings exportedNames
L loc (TyClD _ ClassDecl {..}) -> do
mdef <- minimalDef t
- let sig = maybeToList $ fmap (noLocA . MinimalSig noAnn NoSourceText . noLocA . fmap noLocA) mdef
+ let sig = maybeToList $ fmap (noLocA . MinimalSig (noAnn, NoSourceText) . noLocA . fmap noLocA) mdef
availExportDecl avail
(L loc $ TyClD noExtField ClassDecl { tcdSigs = sig ++ tcdSigs, .. }) docs_
diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs
index d2f11733..b3d31940 100644
--- a/haddock-api/src/Haddock/Interface/Rename.hs
+++ b/haddock-api/src/Haddock/Interface/Rename.hs
@@ -308,7 +308,7 @@ renameType t = case t of
doc' <- renameLDocHsSyn doc
return (HsDocTy noAnn ty' doc')
- HsTyLit _ x -> return (HsTyLit noAnn x)
+ HsTyLit _ x -> return (HsTyLit noAnn (renameTyLit x))
HsRecTy _ a -> HsRecTy noAnn <$> mapM renameConDeclFieldField a
XHsType a -> pure (XHsType a)
@@ -318,6 +318,12 @@ renameType t = case t of
HsSpliceTy (HsUntypedSpliceNested _) _ -> error "renameType: not an top level type splice"
HsWildCardTy _ -> pure (HsWildCardTy noAnn)
+renameTyLit :: HsTyLit GhcRn -> HsTyLit DocNameI
+renameTyLit t = case t of
+ HsNumTy _ v -> HsNumTy noExtField v
+ HsStrTy _ v -> HsStrTy noExtField v
+ HsCharTy _ v -> HsCharTy noExtField v
+
renameSigType :: HsSigType GhcRn -> RnM (HsSigType DocNameI)
renameSigType (HsSig { sig_bndrs = bndrs, sig_body = body }) = do
@@ -576,9 +582,9 @@ renameSig sig = case sig of
FixSig _ (FixitySig _ lnames fixity) -> do
lnames' <- mapM renameL lnames
return $ FixSig noExtField (FixitySig noExtField lnames' fixity)
- MinimalSig _ src (L l s) -> do
+ MinimalSig _ (L l s) -> do
s' <- traverse (traverse lookupRnNoWarn) s
- return $ MinimalSig noExtField src (L l s')
+ return $ MinimalSig noExtField (L l s')
-- we have filtered out all other kinds of signatures in Interface.Create
_ -> error "expected TypeSig"
@@ -587,11 +593,17 @@ renameForD :: ForeignDecl GhcRn -> RnM (ForeignDecl DocNameI)
renameForD (ForeignImport _ lname ltype x) = do
lname' <- renameL lname
ltype' <- renameLSigType ltype
- return (ForeignImport noExtField lname' ltype' x)
+ return (ForeignImport noExtField lname' ltype' (renameForI x))
renameForD (ForeignExport _ lname ltype x) = do
lname' <- renameL lname
ltype' <- renameLSigType ltype
- return (ForeignExport noExtField lname' ltype' x)
+ return (ForeignExport noExtField lname' ltype' (renameForE x))
+
+renameForI :: ForeignImport GhcRn -> ForeignImport DocNameI
+renameForI (CImport _ cconv safety mHeader spec) = CImport noExtField cconv safety mHeader spec
+
+renameForE :: ForeignExport GhcRn -> ForeignExport DocNameI
+renameForE (CExport _ spec) = CExport noExtField spec
renameInstD :: InstDecl GhcRn -> RnM (InstDecl DocNameI)