[commit: ghc] master: Add some extra debugging info (f7e33ca)

Ian Lynagh igloo at earth.li
Sun May 19 19:32:57 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

https://github.com/ghc/ghc/commit/f7e33ca75eb1fffd5d4d84c109980e0ebf207743

>---------------------------------------------------------------

commit f7e33ca75eb1fffd5d4d84c109980e0ebf207743
Author: Ian Lynagh <ian at well-typed.com>
Date:   Sun May 19 15:49:21 2013 +0100

    Add some extra debugging info

>---------------------------------------------------------------

 compiler/typecheck/TcRnMonad.lhs | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/compiler/typecheck/TcRnMonad.lhs b/compiler/typecheck/TcRnMonad.lhs
index 452a105..cd164b9 100644
--- a/compiler/typecheck/TcRnMonad.lhs
+++ b/compiler/typecheck/TcRnMonad.lhs
@@ -44,12 +44,12 @@ import Outputable
 import UniqSupply
 import UniqFM
 import DynFlags
-import Maybes
 import StaticFlags
 import FastString
 import Panic
 import Util
 
+import Control.Exception
 import Data.IORef
 import qualified Data.Set as Set
 import Control.Monad
@@ -187,7 +187,11 @@ initTcPrintErrors       -- Used from the interactive loop only
 initTcPrintErrors env mod todo = initTc env HsSrcFile False mod todo
 
 initTcForLookup :: HscEnv -> TcM a -> IO a
-initTcForLookup hsc_env = liftM (expectJust "initTcInteractive" . snd) . initTc hsc_env HsSrcFile False iNTERACTIVE
+initTcForLookup hsc_env tcm
+    = do (msgs, m) <- initTc hsc_env HsSrcFile False iNTERACTIVE tcm
+         case m of
+             Nothing -> throwIO $ mkSrcErr $ snd msgs
+             Just x -> return x
 \end{code}
 
 %************************************************************************





More information about the ghc-commits mailing list