Skip to content

Commit

Permalink
Make sure to give the correct DynFlags to the recompilation checker
Browse files Browse the repository at this point in the history
We were passing the wrong DynFlags here, causing most modules with a LANGUAGE pragma
to fail the recompilation check and have their interface files regenerated
  • Loading branch information
pepeiborra committed Feb 28, 2021
1 parent 43b33a5 commit 6351c28
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ghcide/src/Development/IDE/Core/Compile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,8 @@ loadInterface
-> (Maybe LinkableType -> m ([FileDiagnostic], Maybe HiFileResult)) -- ^ Action to regenerate an interface
-> m ([FileDiagnostic], Maybe HiFileResult)
loadInterface session ms sourceMod linkableNeeded regen = do
res <- liftIO $ checkOldIface session ms sourceMod Nothing
let sessionWithMsDynFlags = session{hsc_dflags = ms_hspp_opts ms}
res <- liftIO $ checkOldIface sessionWithMsDynFlags ms sourceMod Nothing
case res of
(UpToDate, Just iface)
-- If the module used TH splices when it was last
Expand Down Expand Up @@ -914,7 +915,7 @@ loadInterface session ms sourceMod linkableNeeded regen = do
Just (LM obj_time _ _) -> obj_time > ms_hs_date ms
if objUpToDate
then do
hmi <- liftIO $ mkDetailsFromIface session iface linkable
hmi <- liftIO $ mkDetailsFromIface sessionWithMsDynFlags iface linkable
return ([], Just $ HiFileResult ms hmi)
else regen linkableNeeded
(_reason, _) -> regen linkableNeeded
Expand Down

0 comments on commit 6351c28

Please sign in to comment.