diff options
author | Simon Marlow <marlowsd@gmail.com> | 2016-01-07 14:53:43 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2016-01-08 08:49:26 +0000 |
commit | 09425cbe4fb93ac3af4932937478d46972ecf91f (patch) | |
tree | cb17781efe0a8672fec91639aac23a309ffad691 /compiler/main/ErrUtils.hs | |
parent | 6be09e884730f19da6c24fc565980f515300e53c (diff) | |
download | haskell-09425cbe4fb93ac3af4932937478d46972ecf91f.tar.gz |
Support for qRecover in TH with -fexternal-interpreter
Summary: This completes the support for TH with -fexternal-interpreter.
Test Plan: validate
Reviewers: bgamari, ezyang, austin, niteria, goldfire, erikd
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1748
GHC Trac Issues: #11100
Diffstat (limited to 'compiler/main/ErrUtils.hs')
-rw-r--r-- | compiler/main/ErrUtils.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/main/ErrUtils.hs b/compiler/main/ErrUtils.hs index 0677240522..11b30fd13c 100644 --- a/compiler/main/ErrUtils.hs +++ b/compiler/main/ErrUtils.hs @@ -14,6 +14,7 @@ module ErrUtils ( -- * Messages MsgDoc, ErrMsg, ErrDoc, errDoc, WarnMsg, Messages, ErrorMessages, WarningMessages, + unionMessages, errMsgSpan, errMsgContext, errorsFound, isEmptyMessages, @@ -48,7 +49,7 @@ module ErrUtils ( #include "HsVersions.h" -import Bag ( Bag, bagToList, isEmptyBag, emptyBag ) +import Bag import Exception import Outputable import Panic @@ -100,6 +101,10 @@ type Messages = (WarningMessages, ErrorMessages) type WarningMessages = Bag WarnMsg type ErrorMessages = Bag ErrMsg +unionMessages :: Messages -> Messages -> Messages +unionMessages (warns1, errs1) (warns2, errs2) = + (warns1 `unionBags` warns2, errs1 `unionBags` errs2) + data ErrMsg = ErrMsg { errMsgSpan :: SrcSpan, errMsgContext :: PrintUnqualified, |