Skip to content

Commit 36299b2

Browse files
committed
fix template haskell 9.12.2
1 parent 596bb42 commit 36299b2

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

ghcide/src/Development/IDE/Core/Compile.hs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ captureSplicesAndDeps TypecheckHelpers{..} env k = do
353353
{- load it -}
354354
#if MIN_VERSION_ghc(9,11,0)
355355
; bco_time <- getCurrentTime
356-
; (fv_hvs, lbss, pkgs) <- loadDecls (hscInterp hsc_env) hsc_env srcspan $
356+
; (fv_hvs, lbss, pkgs) <- loadDecls (hscInterp hsc_env') hsc_env' srcspan $
357357
Linkable bco_time (icInteractiveModule ictxt) $ NE.singleton $ BCOs bcos
358358
; let hval = ((expectJust "hscCompileCoreExpr'" $ lookup (idName binding_id) fv_hvs), lbss, pkgs)
359359
#else
@@ -733,11 +733,13 @@ generateByteCode (CoreFileTime time) hscEnv summary guts = do
733733
(warnings, (_, bytecode, sptEntries)) <-
734734
#endif
735735
withWarnings "bytecode" $ \_tweak -> do
736-
let session = _tweak (hscSetFlags (ms_hspp_opts summary) hscEnv)
737-
-- TODO: maybe settings ms_hspp_opts is unnecessary?
738-
summary' = summary { ms_hspp_opts = hsc_dflags session }
739-
hscInteractive session (mkCgInteractiveGuts guts)
740-
(ms_location summary')
736+
let session = _tweak (hscSetFlags (ms_hspp_opts summary) hscEnv)
737+
-- TODO: maybe settings ms_hspp_opts is unnecessary?
738+
summary' = summary {ms_hspp_opts = hsc_dflags session}
739+
hscInteractive
740+
session
741+
(mkCgInteractiveGuts guts)
742+
(ms_location summary')
741743
#if MIN_VERSION_ghc(9,11,0)
742744
let unlinked = BCOs bytecode
743745
#else
@@ -1630,14 +1632,14 @@ coreFileToCgGuts session iface details core_file = do
16301632
})
16311633
core_binds <- initIfaceCheck (text "l") hsc_env' $ typecheckCoreFile this_mod types_var core_file
16321634
-- Implicit binds aren't saved, so we need to regenerate them ourselves.
1633-
let _implicit_binds = concatMap getImplicitBinds tyCons -- only used if GHC < 9.6
1634-
tyCons = typeEnvTyCons (md_types details)
1635+
let tyCons = typeEnvTyCons (md_types details)
16351636
#if MIN_VERSION_ghc(9,11,0)
16361637
pure $ CgGuts this_mod tyCons core_binds [] NoStubs [] mempty Nothing []
16371638
#elif MIN_VERSION_ghc(9,5,0)
16381639
-- In GHC 9.6, the implicit binds are tidied and part of core_binds
16391640
pure $ CgGuts this_mod tyCons core_binds [] NoStubs [] mempty (emptyHpcInfo False) Nothing []
16401641
#else
1642+
let _implicit_binds = concatMap getImplicitBinds tyCons -- only used if GHC < 9.6
16411643
pure $ CgGuts this_mod tyCons (_implicit_binds ++ core_binds) [] NoStubs [] mempty (emptyHpcInfo False) Nothing []
16421644
#endif
16431645

0 commit comments

Comments
 (0)