diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-01-30 13:53:47 +0000 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-01-30 17:43:44 +0000 |
commit | 1bb4913c3c9b1942c014475e38f2f8cf8b61be68 (patch) | |
tree | 0e14cf138c0e1144d3ccd25e309d6a6d824277cf | |
parent | 426b9b058bebb4b3c10e055c42c6e4924b3b9b0c (diff) | |
download | haskell-1bb4913c3c9b1942c014475e38f2f8cf8b61be68.tar.gz |
Use throwGhcExceptionIO rather than throwGhcException in InteractiveEval.hs
-rw-r--r-- | compiler/main/InteractiveEval.hs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index 4b23ad010a..1d74c63a3b 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -499,7 +499,8 @@ resume canLogSpan step resume = ic_resume ic case resume of - [] -> throwGhcException (ProgramError "not stopped at a breakpoint") + [] -> liftIO $ + throwGhcExceptionIO (ProgramError "not stopped at a breakpoint") (r:rs) -> do -- unbind the temporary locals by restoring the TypeEnv from -- before the breakpoint, and drop this Resume from the @@ -557,16 +558,17 @@ moveHist :: GhcMonad m => (Int -> Int) -> m ([Name], Int, SrcSpan) moveHist fn = do hsc_env <- getSession case ic_resume (hsc_IC hsc_env) of - [] -> throwGhcException (ProgramError "not stopped at a breakpoint") + [] -> liftIO $ + throwGhcExceptionIO (ProgramError "not stopped at a breakpoint") (r:rs) -> do let ix = resumeHistoryIx r history = resumeHistory r new_ix = fn ix -- - when (new_ix > length history) $ - throwGhcException (ProgramError "no more logged breakpoints") - when (new_ix < 0) $ - throwGhcException (ProgramError "already at the beginning of the history") + when (new_ix > length history) $ liftIO $ + throwGhcExceptionIO (ProgramError "no more logged breakpoints") + when (new_ix < 0) $ liftIO $ + throwGhcExceptionIO (ProgramError "already at the beginning of the history") let update_ic apStack mb_info = do @@ -848,7 +850,8 @@ setContext imports ; let dflags = hsc_dflags hsc_env ; all_env_err <- liftIO $ findGlobalRdrEnv hsc_env imports ; case all_env_err of - Left (mod, err) -> throwGhcException (formatError dflags mod err) + Left (mod, err) -> + liftIO $ throwGhcExceptionIO (formatError dflags mod err) Right all_env -> do { ; let old_ic = hsc_IC hsc_env final_rdr_env = ic_tythings old_ic `icPlusGblRdrEnv` all_env |