Commit 91aacc78 authored by Alfredo Di Napoli's avatar Alfredo Di Napoli

Rebase fixup

parent c22cb879
Pipeline #32344 passed with stages
in 304 minutes and 19 seconds
......@@ -26,7 +26,7 @@ printBagOfErrors :: Diagnostic a => Logger -> DynFlags -> Bag (MsgEnvelope a) ->
printBagOfErrors logger dflags bag_of_errors
= sequence_ [ let style = mkErrStyle unqual
ctx = initSDocContext dflags style
in putLogMsg logger dflags (UnsafeMCDiagnostic sev . diagnosticReason $ dia) s $
in putLogMsg logger dflags (MCDiagnostic sev . diagnosticReason $ dia) s $
withPprStyle style (formatBulleted ctx (diagnosticMessage dia))
| MsgEnvelope { errMsgSpan = s,
errMsgDiagnostic = dia,
......
......@@ -884,13 +884,14 @@ maybeReportError ctxt msg
-- 'DynFlags' in scope at the time of construction. However, due to the intricacies of
-- the current error-deferring logic, we are not always able to enforce this invariant
-- and we rather have to change one or the other /a posteriori/.
reclassify :: DiagnosticReason
reclassify :: DynFlags
-> DiagnosticReason
-> MsgEnvelope DiagnosticMessage
-> MsgEnvelope DiagnosticMessage
reclassify rea msg =
reclassify dflags rea msg =
let set_reason r m = m { errMsgDiagnostic = (errMsgDiagnostic m) { diagReason = r } }
set_severity s m = m { errMsgSeverity = s }
in set_severity (defaultReasonSeverity rea) . set_reason rea $ msg
in set_severity (diagReasonSeverity dflags rea) . set_reason rea $ msg
addDeferredBinding :: ReportErrCtxt -> MsgEnvelope DiagnosticMessage -> Ct -> TcM ()
-- See Note [Deferring coercion errors to runtime]
......
......@@ -114,7 +114,7 @@ mkMsgEnvelope dflags locn print_unqual err
-- | Make a 'MessageClass' for a given 'DiagnosticReason', consulting the 'DynFlags'.
mkMCDiagnostic :: DynFlags -> DiagnosticReason -> MessageClass
mkMCDiagnostic dflags reason = UnsafeMCDiagnostic (diagReasonSeverity dflags reason) reason
mkMCDiagnostic dflags reason = MCDiagnostic (diagReasonSeverity dflags reason) reason
-- | A long (multi-line) diagnostic message.
-- The 'Severity' will be calculated out of the 'DiagnosticReason', and will likely be
......@@ -200,7 +200,7 @@ pprLocMsgEnvelope (MsgEnvelope { errMsgSpan = s
, errMsgContext = unqual })
= sdocWithContext $ \ctx ->
withErrStyle unqual $
mkLocMessage (UnsafeMCDiagnostic sev (diagnosticReason e)) s (formatBulleted ctx $ diagnosticMessage e)
mkLocMessage (MCDiagnostic sev (diagnosticReason e)) s (formatBulleted ctx $ diagnosticMessage e)
sortMsgBag :: Maybe DynFlags -> Bag (MsgEnvelope e) -> [MsgEnvelope e]
sortMsgBag dflags = maybeLimit . sortBy (cmp `on` errMsgSpan) . bagToList
......
......@@ -65,7 +65,6 @@ import GHC.Hs.ImpExp
import GHC.Hs
import GHC.Driver.Env
import GHC.Runtime.Context
import GHC.Types.Error
import GHC.Types.TyThing
import GHC.Types.TyThing.Ppr
import GHC.Types.SafeHaskell ( getSafeMode )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment