[Pkg-haskell-commits] darcs: ghc: add missing ghc-ignore-ANN-annotation

joeyh at debian.org joeyh at debian.org
Sun Sep 28 18:27:25 UTC 2014


Sun Sep 28 18:25:33 UTC 2014  joeyh at debian.org
  * add missing ghc-ignore-ANN-annotation
  
  Someone seems to have forgotten to check this into darcs while adding it to
  a past release of ghc

    A ./patches/ghc-ignore-ANN-annotation.patch

Sun Sep 28 18:25:33 UTC 2014  joeyh at debian.org
  * add missing ghc-ignore-ANN-annotation
  
  Someone seems to have forgotten to check this into darcs while adding it to
  a past release of ghc
diff -rN -u old-ghc/patches/ghc-ignore-ANN-annotation.patch new-ghc/patches/ghc-ignore-ANN-annotation.patch
--- old-ghc/patches/ghc-ignore-ANN-annotation.patch	1970-01-01 00:00:00.000000000 +0000
+++ new-ghc/patches/ghc-ignore-ANN-annotation.patch	2014-09-28 18:27:25.123410720 +0000
@@ -0,0 +1,35 @@
+diff -uNr ghc-7.6.3.orig/compiler/typecheck/TcAnnotations.lhs ghc-7.6.3/compiler/typecheck/TcAnnotations.lhs
+--- ghc-7.6.3.orig/compiler/typecheck/TcAnnotations.lhs	2013-04-18 21:22:46.000000000 +0000
++++ ghc-7.6.3/compiler/typecheck/TcAnnotations.lhs	2014-06-26 08:23:10.000000000 +0000
+@@ -18,19 +16,26 @@
+ import Module
+ import TcExpr
+ import {-# SOURCE #-} TcSplice ( runAnnotation )
+-import FastString
+ #endif
++
++import FastString
+ \end{code}
+ 
+ \begin{code}
+ tcAnnotations :: [LAnnDecl Name] -> TcM [Annotation]
+-tcAnnotations = mapM tcAnnotation
+ 
+-tcAnnotation :: LAnnDecl Name -> TcM Annotation
+ #ifndef GHCI
+--- TODO: modify lexer so ANN pragmas are parsed as comments in a stage1 compiler, so developers don't see this error
+-tcAnnotation (L _ (HsAnnotation _ expr)) = pprPanic "Cant do annotations without GHCi" (ppr expr)
++-- No GHCI; emit a warning (not an error) and ignore. cf Trac #4268
++tcAnnotations [] = return []
++tcAnnotations anns@(L loc _ : _)
++  = do { setSrcSpan loc $ addWarnTc $
++             (ptext (sLit "Ignoring ANN annotation") <> plural anns <> comma
++             <+> ptext (sLit "because this is a stage-1 compiler or doesn't support GHCi"))
++       ; return [] }
+ #else
++tcAnnotations = mapM tcAnnotation
++
++tcAnnotation :: LAnnDecl Name -> TcM Annotation
+ tcAnnotation ann@(L loc (HsAnnotation provenance expr)) = do
+     -- Work out what the full target of this annotation was
+     mod <- getModule




More information about the Pkg-haskell-commits mailing list