From 8deb1cd57c4badb0905051daaa0e8981583a4416 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Mon, 13 Feb 2012 10:39:37 +0900 Subject: [PATCH] catching mutual module import. --- ErrMsg.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ErrMsg.hs b/ErrMsg.hs index 7a858ad..95ddc79 100644 --- a/ErrMsg.hs +++ b/ErrMsg.hs @@ -57,10 +57,9 @@ ppErrMsg err = ppMsg spn msg defaultUserStyle ++ ext ppMsg :: SrcSpan -> Message -> PprStyle -> String #if __GLASGOW_HASKELL__ >= 702 -ppMsg (UnhelpfulSpan _) _ _ = undefined ppMsg (RealSrcSpan src) msg stl #else -ppMsg src msg stl +ppMsg src msg stl | isGoodSrcSpan src #endif = file ++ ":" ++ line ++ ":" ++ col ++ ":" ++ cts ++ "\0" where @@ -68,12 +67,13 @@ ppMsg src msg stl line = show (srcSpanStartLine src) col = show (srcSpanStartCol src) cts = showMsg msg stl +ppMsg _ _ _ = "ghc-mod:0:0:Probably mutual module import occurred\0" ---------------------------------------------------------------- showMsg :: SDoc -> PprStyle -> String #if __GLASGOW_HASKELL__ >= 702 -showMsg d stl = map toNull $ renderWithStyle d stl +showMsg d stl = map toNull . renderWithStyle d $ stl #else showMsg d stl = map toNull . Pretty.showDocWith PageMode $ d stl #endif