Skip to content

Instantly share code, notes, and snippets.

@christiaanb
Created October 5, 2013 07:34
Show Gist options
  • Save christiaanb/6837931 to your computer and use it in GitHub Desktop.
Save christiaanb/6837931 to your computer and use it in GitHub Desktop.
diff --git a/src/Haddock.hs b/src/Haddock.hs
index a7ac5ba..2cd220c 100644
--- a/src/Haddock.hs
+++ b/src/Haddock.hs
@@ -113,6 +113,11 @@ handleGhcExceptions =
case e of
PhaseFailed _ code -> exitWith code
_ -> do
+ flags <- saveStaticFlagGlobals
+ unless (fst flags) $ do
+ _ <- parseStaticFlags []
+ return ()
+
print (e :: GhcException)
exitFailure
@@ -318,7 +323,7 @@ withGhc libDir flags ghcActs = saveStaticFlagGlobals >>= \savedFlags -> do
(restFlags, _) <- parseStaticFlags (map noLoc flags)
runGhc (Just libDir) $ do
dynflags <- getSessionDynFlags
- let dynflags' = gopt_set dynflags Opt_Haddock
+ let dynflags' = dopt_set (gopt_set dynflags Opt_Haddock) Opt_D_dump_if_trace
let dynflags'' = dynflags' {
hscTarget = HscNothing,
ghcMode = CompManager,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment