aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Interface
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2018-06-07 15:45:22 +0300
committerBen Gamari <ben@smart-cactus.org>2018-06-14 17:06:21 -0400
commit97c6cb949ffe707865b9c46016f97b441d114e45 (patch)
treea81623757978b726043bb42cc55e4000d41bcd13 /haddock-api/src/Haddock/Interface
parent5b25163bad9c28040fdc61555659b4b4b6168032 (diff)
Handle -XStarIsType
Diffstat (limited to 'haddock-api/src/Haddock/Interface')
-rw-r--r--haddock-api/src/Haddock/Interface/Rename.hs3
-rw-r--r--haddock-api/src/Haddock/Interface/Specialize.hs2
2 files changed, 3 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs
index c07f8300..86d9fd6a 100644
--- a/haddock-api/src/Haddock/Interface/Rename.hs
+++ b/haddock-api/src/Haddock/Interface/Rename.hs
@@ -233,6 +233,8 @@ renameType t = case t of
HsTyVar _ ip (L l n) -> return . HsTyVar NoExt ip . L l =<< rename n
HsBangTy _ b ltype -> return . HsBangTy NoExt b =<< renameLType ltype
+ HsStarTy _ isUni -> return (HsStarTy NoExt isUni)
+
HsAppTy _ a b -> do
a' <- renameLType a
b' <- renameLType b
@@ -276,7 +278,6 @@ renameType t = case t of
HsExplicitTupleTy a b -> HsExplicitTupleTy a <$> mapM renameLType b
HsSpliceTy _ s -> renameHsSpliceTy s
HsWildCardTy a -> HsWildCardTy <$> renameWildCardInfo a
- HsAppsTy _ _ -> error "renameType: HsAppsTy"
-- | Rename splices, but _only_ those that turn out to be for types.
-- I think this is actually safe for our possible inputs:
diff --git a/haddock-api/src/Haddock/Interface/Specialize.hs b/haddock-api/src/Haddock/Interface/Specialize.hs
index 2fcb495c..4419e110 100644
--- a/haddock-api/src/Haddock/Interface/Specialize.hs
+++ b/haddock-api/src/Haddock/Interface/Specialize.hs
@@ -254,6 +254,7 @@ renameType (HsQualTy x lctxt lt) =
<$> located renameContext lctxt
<*> renameLType lt
renameType (HsTyVar x ip name) = HsTyVar x ip <$> located renameName name
+renameType t@(HsStarTy _ _) = pure t
renameType (HsAppTy x lf la) = HsAppTy x <$> renameLType lf <*> renameLType la
renameType (HsFunTy x la lr) = HsFunTy x <$> renameLType la <*> renameLType lr
renameType (HsListTy x lt) = HsListTy x <$> renameLType lt
@@ -276,7 +277,6 @@ renameType (HsExplicitTupleTy x ltys) =
HsExplicitTupleTy x <$> renameLTypes ltys
renameType t@(HsTyLit _ _) = pure t
renameType (HsWildCardTy wc) = pure (HsWildCardTy wc)
-renameType (HsAppsTy _ _) = error "HsAppsTy: Only used before renaming"
renameLType :: LHsType GhcRn -> Rename (IdP GhcRn) (LHsType GhcRn)