Commit 48e475e4 authored by Gergely Risko's avatar Gergely Risko Committed by Austin Seipp
Browse files

Fix annotation reification for home package modules

The reifyAnnotation method of the Q monad correctly gathered annotations
from TCG and EPS.  Unfortunately it didn't look into the Home Package
Table.  This resulted in annotations not being found if they are in the
same package as the splice that is reifying and ghc --make is used for
compilation management.  Fix this by using the already existing
prepareAnnotations method from HscTypes.lhs that correctly searches
in HPT and EPS both.
Signed-off-by: default avatarAustin Seipp <>
parent 3c990bf5
......@@ -1507,13 +1507,14 @@ lookupThAnnLookup (TH.AnnLookupModule (TH.Module pn mn))
mkModule (stringToPackageId $ TH.pkgString pn) (mkModuleName $ TH.modString mn)
reifyAnnotations :: Data a => TH.AnnLookup -> TcM [a]
reifyAnnotations th_nm
= do { name <- lookupThAnnLookup th_nm
; eps <- getEps
reifyAnnotations th_name
= do { name <- lookupThAnnLookup th_name
; topEnv <- getTopEnv
; epsHptAnns <- liftIO $ prepareAnnotations topEnv Nothing
; tcg <- getGblEnv
; let epsAnns = findAnns deserializeWithData (eps_ann_env eps) name
; let envAnns = findAnns deserializeWithData (tcg_ann_env tcg) name
; return (envAnns ++ epsAnns) }
; let selectedEpsHptAnns = findAnns deserializeWithData epsHptAnns name
; let selectedTcgAnns = findAnns deserializeWithData (tcg_ann_env tcg) name
; return (selectedEpsHptAnns ++ selectedTcgAnns) }
modToTHMod :: Module -> TH.Module
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment