[commit: ghc] master: Wibbles to 'Tidy up the error messages we get from TH' (c314e64)

git at git.haskell.org git at git.haskell.org
Wed Nov 6 16:39:57 UTC 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c314e64c4c5f4d41fab4c13f9023052ab76f670d/ghc

>---------------------------------------------------------------

commit c314e64c4c5f4d41fab4c13f9023052ab76f670d
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Nov 6 16:39:46 2013 +0000

    Wibbles to 'Tidy up the error messages we get from TH'


>---------------------------------------------------------------

c314e64c4c5f4d41fab4c13f9023052ab76f670d
 compiler/main/DynFlags.hs            |    2 +-
 compiler/typecheck/TcAnnotations.lhs |    3 +--
 compiler/typecheck/TcRnMonad.lhs     |    8 ++++----
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 0116dae..b88e294 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -3117,7 +3117,7 @@ checkTemplateHaskellOk turn_on
 #else
 -- In stage 1, Template Haskell is simply illegal
 checkTemplateHaskellOk turn_on
-  | turn_on   = addWarn "Template Haskell requires GHC with interpreter support\nPerhaps you are using a stage-1 compiler?"
+  | turn_on   = addWarn "Template Haskell requires GHC with interpreter support\n    Perhaps you are using a stage-1 compiler?"
   | otherwise = return ()
 #endif
 
diff --git a/compiler/typecheck/TcAnnotations.lhs b/compiler/typecheck/TcAnnotations.lhs
index 4f4ab60..c25a217 100644
--- a/compiler/typecheck/TcAnnotations.lhs
+++ b/compiler/typecheck/TcAnnotations.lhs
@@ -17,7 +17,6 @@ import SrcLoc
 import Outputable
 
 import Module
-import TcExpr
 import FastString
 \end{code}
 
@@ -32,7 +31,7 @@ tcAnnotation ann@(L loc (HsAnnotation provenance expr)) = do
     let target = annProvenanceToTarget mod provenance
 
     -- Run that annotation and construct the full Annotation data structure
-    setSrcSpan loc $ addErrCtxt (annCtxt ann) $ addExprErrCtxt expr $ runAnnotation target expr
+    setSrcSpan loc $ addErrCtxt (annCtxt ann) $ runAnnotation target expr
 
 annProvenanceToTarget :: Module -> AnnProvenance Name -> AnnTarget Name
 annProvenanceToTarget _   (ValueAnnProvenance name) = NamedTarget name
diff --git a/compiler/typecheck/TcRnMonad.lhs b/compiler/typecheck/TcRnMonad.lhs
index 1b66b94..0e064ad 100644
--- a/compiler/typecheck/TcRnMonad.lhs
+++ b/compiler/typecheck/TcRnMonad.lhs
@@ -838,10 +838,10 @@ checkTH e what = failTH e what  -- Raise an error in a stage-1 compiler
 
 failTH :: Outputable a => a -> String -> TcRn x
 failTH e what  -- Raise an error in a stage-1 compiler
-  = failWithTc (vcat [ text what
-                       <+> ptext (sLit "requires GHC with interpreter support")
-                     , ptext (sLit "Perhaps you are using a stage-1 compiler?")
-                     , nest 2 (ppr e)])
+  = failWithTc (vcat [ hang (char 'A' <+> text what
+                             <+> ptext (sLit "requires GHC with interpreter support:"))
+                          2 (ppr e)
+                     , ptext (sLit "Perhaps you are using a stage-1 compiler?") ])
 \end{code}
 
 



More information about the ghc-commits mailing list