X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fmain%2FErrUtils.lhs;h=bf9a663e5e2bc77e7b8103b5a7039a70d7355adf;hb=59c796f8e77325d35f29ddd3e724bfa780466d40;hp=3a5364466a78947c2dc5de72443d15d8875e94c9;hpb=423d477bfecd490de1449c59325c8776f91d7aac;p=ghc-hetmet.git diff --git a/ghc/compiler/main/ErrUtils.lhs b/ghc/compiler/main/ErrUtils.lhs index 3a53644..bf9a663 100644 --- a/ghc/compiler/main/ErrUtils.lhs +++ b/ghc/compiler/main/ErrUtils.lhs @@ -23,7 +23,7 @@ module ErrUtils ( import Bag ( Bag, bagToList, isEmptyBag, emptyBag ) import SrcLoc ( SrcSpan ) -import Util ( sortLt ) +import Util ( sortLe ) import Outputable import qualified Pretty import SrcLoc ( srcSpanStart ) @@ -130,10 +130,13 @@ pprBagOfErrors bag_of_errors errMsgContext = unqual } <- sorted_errs ] where bag_ls = bagToList bag_of_errors - sorted_errs = sortLt occ'ed_before bag_ls + sorted_errs = sortLe occ'ed_before bag_ls occ'ed_before err1 err2 = - LT == compare (head (errMsgSpans err1)) (head (errMsgSpans err2)) + case compare (head (errMsgSpans err1)) (head (errMsgSpans err2)) of + LT -> True + EQ -> True + GT -> False pprBagOfWarnings :: Bag WarnMsg -> Pretty.Doc pprBagOfWarnings bag_of_warns = pprBagOfErrors bag_of_warns