Skip to content

Commit

Permalink
fix exit code of ghci -e "return ()"
Browse files Browse the repository at this point in the history
This should result in successful program termination. Not doing this
breaks checking the exit code of  runghc Setup.lhs build  for example.
  • Loading branch information
int-e committed May 3, 2007
1 parent 74da126 commit cbe2843
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion compiler/ghci/InteractiveUI.hs
Expand Up @@ -539,7 +539,7 @@ runStmt stmt step
result <- io $ withProgName (progname st) $ withArgs (args st) $
GHC.runStmt session stmt step
afterRunStmt result
return False
return (isRunResultOk result)


afterRunStmt :: GHC.RunResult -> GHCi (Maybe (Bool,[Name]))
Expand Down Expand Up @@ -583,6 +583,11 @@ switchOnRunResult (GHC.RunBreak threadId names info) = do
return (Just (True,names))


isRunResultOk :: GHC.RunResult -> Bool
isRunResultOk (GHC.RunOk _) = True
isRunResultOk _ = False


showTypeOfName :: Session -> Name -> GHCi ()
showTypeOfName session n
= do maybe_tything <- io (GHC.lookupName session n)
Expand Down

0 comments on commit cbe2843

Please sign in to comment.