Skip to content
Commits on Source (3)
ghc (8.0.2-11) UNRELEASED; urgency=medium
ghc (8.0.2-11) unstable; urgency=medium
[ Ilias Tsitsimpis ]
* Change Priority to optional. Since Debian Policy version 4.0.1,
priority extra has been deprecated.
* Use the HTTPS form of the copyright-format URL
* Modify d/watch and Source field in d/copyright to use HTTPS
* Declare compliance with Debian policy 4.1.1
-- Ilias Tsitsimpis <iliastsi@debian.org> Wed, 01 Nov 2017 12:13:33 +0200
[ Sean Whitton ]
* Add fix-hssplicety.patch (Closes: #867195).
-- Sean Whitton <spwhitton@spwhitton.name> Tue, 06 Feb 2018 14:01:18 -0700
ghc (8.0.2-10) unstable; urgency=medium
......
From: Alec Theriault <alec.theriault@gmail.com>
Date: Mon, 5 Feb 2018 13:45:47 -0800
Subject: [PATCH] Don't barf on 'HsSpliceTy'
Applied-Upstream: https://github.com/haskell/haddock/commit/76d0f9b90a7b2f65ae12e1ce5dd0552909493252
This handles 'HsSpliceTy's by replacing them with what they expand to.
IIUC everything that is happening, 'renameHsSpliceTy' should not be
able to fail for the inputs we feed it from GHC.
This fixes #574.
---
utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
--- a/utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
+++ b/utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
@@ -263,10 +263,21 @@ renameType t = case t of
HsCoreTy a -> pure (HsCoreTy a)
HsExplicitListTy a b -> HsExplicitListTy a <$> mapM renameLType b
HsExplicitTupleTy a b -> HsExplicitTupleTy a <$> mapM renameLType b
- HsSpliceTy _ _ -> error "renameType: HsSpliceTy"
+ 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:
+--
+-- * the input is from after GHC's renamer, so should have an 'HsSpliced'
+-- * the input is typechecked, and only 'HsSplicedTy' should get through that
+--
+renameHsSpliceTy :: HsSplice Name -> RnM (HsType DocName)
+renameHsSpliceTy (HsSpliced _ (HsSplicedTy t)) = renameType t
+renameHsSpliceTy (HsSpliced _ _) = error "renameHsSpliceTy: not an HsSplicedTy"
+renameHsSpliceTy _ = error "renameHsSpliceTy: not an HsSpliced"
+
renameLHsQTyVars :: LHsQTyVars Name -> RnM (LHsQTyVars DocName)
renameLHsQTyVars (HsQTvs { hsq_implicit = _, hsq_explicit = tvs })
= do { tvs' <- mapM renameLTyVarBndr tvs
......@@ -11,3 +11,4 @@ osdecommitmemory-compat.patch
use-stage1-binaries-for-install.patch
build-unlit-and-hp2ps-twice.patch
avoid-CrossCompilerPrefix-stage2.patch
fix-hssplicety.patch