Skip to content

Ghcide patch fail to compile TH code for 9.12.2

I found this issue trying to migrate HLS to 9.12.2 at https://github.com/haskell/haskell-language-server/pull/4517. We use the wrong hsc_env here, just need to change to hsc_env'. Minor fix, I'll offer an MR.

+#if MIN_VERSION_ghc(9,12,0)
+             {- load it -}
+           ; bco_time <- getCurrentTime
+           ; (fv_hvs, lbss, pkgs) <- loadDecls (hscInterp hsc_env) hsc_env srcspan $
+                   Linkable bco_time (icInteractiveModule ictxt) $ NE.singleton $ BCOs bcos
+           ; let hval = ((expectJust "hscCompileCoreExpr'" $ lookup (idName binding_id) fv_hvs), lbss, pkgs)