diff options
| author | Simon Marlow <marlowsd@gmail.com> | 2009-01-30 09:19:19 +0000 |
|---|---|---|
| committer | Simon Marlow <marlowsd@gmail.com> | 2009-01-30 09:19:19 +0000 |
| commit | ee26207114635c480dbc7518c0510545a6f62611 (patch) | |
| tree | 2391f946f3735323ef92b7997051a77210eba152 /compiler/ghci | |
| parent | 57217f68d74c803a189942eb99eed56610ad296b (diff) | |
| download | haskell-ee26207114635c480dbc7518c0510545a6f62611.tar.gz | |
Force the result of user-defined commands
so that exceptions are reported with "*** Exception" instead of as a panic.
Diffstat (limited to 'compiler/ghci')
| -rw-r--r-- | compiler/ghci/InteractiveUI.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index 70a602f16e..8a70787f7e 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -1030,6 +1030,9 @@ defineMacro overwrite s = do runMacro :: GHC.HValue{-String -> IO String-} -> String -> GHCi Bool runMacro fun s = do str <- io ((unsafeCoerce# fun :: String -> IO String) s) + -- make sure we force any exceptions in the result, while we are still + -- inside the exception handler for commands: + seqList str (return ()) enqueueCommands (lines str) return False |
