summaryrefslogtreecommitdiff
path: root/ghc/InteractiveUI.hs
diff options
context:
space:
mode:
authorReid Barton <rwbarton@gmail.com>2014-12-23 16:16:29 -0500
committerReid Barton <rwbarton@gmail.com>2014-12-23 16:16:29 -0500
commitcc510b46b4f6046115cd74acc2c8726c91823bcf (patch)
treeb52fb8532fde8d9b69f9251ffb4a090e58590856 /ghc/InteractiveUI.hs
parent878910e1c4520732ab9d8372c1c81f00d484e48f (diff)
downloadhaskell-cc510b46b4f6046115cd74acc2c8726c91823bcf.tar.gz
Make ghc -e fail on invalid declarations
Summary: Note: This commit includes an API change to GhciMonad.runDecls to allow the caller to determine whether the declarations were run successfully or not. Test Plan: harbormaster Reviewers: austin Reviewed By: austin Subscribers: carter, thomie Differential Revision: https://phabricator.haskell.org/D582
Diffstat (limited to 'ghc/InteractiveUI.hs')
-rw-r--r--ghc/InteractiveUI.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index ce73c48ce5..7125f6d9b3 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -915,8 +915,10 @@ runStmt stmt step
where
run_decl =
do _ <- liftIO $ tryIO $ hFlushAll stdin
- result <- GhciMonad.runDecls stmt
- afterRunStmt (const True) (GHC.RunOk result)
+ m_result <- GhciMonad.runDecls stmt
+ case m_result of
+ Nothing -> return False
+ Just result -> afterRunStmt (const True) (GHC.RunOk result)
run_stmt =
do -- In the new IO library, read handles buffer data even if the Handle