summaryrefslogtreecommitdiff
path: root/compiler/main/ErrUtils.lhs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-07-03 03:11:32 +0100
committerIan Lynagh <igloo@earth.li>2011-07-03 13:57:53 +0100
commite01fffc60ba6a71487f0402f6c79ba2f0a684765 (patch)
tree32f0e93f4f3737963bec303e420b3f72a44f8f47 /compiler/main/ErrUtils.lhs
parent8837193a1235a050581067a227a98a4b339ee6a0 (diff)
downloadhaskell-e01fffc60ba6a71487f0402f6c79ba2f0a684765.tar.gz
defaultErrorHandler now only takes LogAction
It used to take a whole DynFlags, but that meant we had to create a DynFlags with (panic "No settings") for settings, as we didn't have any real settings. Now we just pass the LogAction, which is all that it actually needed. The default is exported from DynFlags as defaultLogAction.
Diffstat (limited to 'compiler/main/ErrUtils.lhs')
-rw-r--r--compiler/main/ErrUtils.lhs9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/main/ErrUtils.lhs b/compiler/main/ErrUtils.lhs
index a0a9f0e3b3..60e1376420 100644
--- a/compiler/main/ErrUtils.lhs
+++ b/compiler/main/ErrUtils.lhs
@@ -24,7 +24,7 @@ module ErrUtils (
-- * Messages during compilation
putMsg, putMsgWith,
errorMsg,
- fatalErrorMsg,
+ fatalErrorMsg, fatalErrorMsg',
compilationProgressMsg,
showPass,
debugTraceMsg,
@@ -36,7 +36,7 @@ import Bag ( Bag, bagToList, isEmptyBag, emptyBag )
import Util ( sortLe )
import Outputable
import SrcLoc
-import DynFlags ( DynFlags(..), DynFlag(..), dopt )
+import DynFlags
import StaticFlags ( opt_ErrorSpans )
import System.Exit ( ExitCode(..), exitWith )
@@ -296,7 +296,10 @@ errorMsg :: DynFlags -> Message -> IO ()
errorMsg dflags msg = log_action dflags SevError noSrcSpan defaultErrStyle msg
fatalErrorMsg :: DynFlags -> Message -> IO ()
-fatalErrorMsg dflags msg = log_action dflags SevFatal noSrcSpan defaultErrStyle msg
+fatalErrorMsg dflags msg = fatalErrorMsg' (log_action dflags) msg
+
+fatalErrorMsg' :: LogAction -> Message -> IO ()
+fatalErrorMsg' la msg = la SevFatal noSrcSpan defaultErrStyle msg
compilationProgressMsg :: DynFlags -> String -> IO ()
compilationProgressMsg dflags msg