[commit: ghc] wip/T10071: Allow deprecations in class decl bodies (9776dc8)

git at git.haskell.org git at git.haskell.org
Mon Sep 28 06:54:47 UTC 2015


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

On branch  : wip/T10071
Link       : http://ghc.haskell.org/trac/ghc/changeset/9776dc838e1fc7ce27d3db0a0d893555ea6487db/ghc

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

commit 9776dc838e1fc7ce27d3db0a0d893555ea6487db
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Fri Jun 5 14:04:18 2015 +0200

    Allow deprecations in class decl bodies
    
    ...and I was helped by Alan to get the types to line up...


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

9776dc838e1fc7ce27d3db0a0d893555ea6487db
 compiler/parser/Parser.y | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y
index b88a3b1..42c85ac 100644
--- a/compiler/parser/Parser.y
+++ b/compiler/parser/Parser.y
@@ -1233,6 +1233,11 @@ decl_cls  : at_decl_cls                 { sLL $1 $> (unitOL $1) }
                           ; ams (sLL $1 $> $ unitOL (sLL $1 $> $ SigD (GenericSig l ty)))
                                 [mj AnnDefault $1,mj AnnDcolon $3] } }
 
+          -- class method-use deprecations (Trac #10071)
+          | '{-# DEPRECATED' deprecations '#-}'
+                    {% ams (sLL $1 $> $ unitOL $ sLL $1 $> $
+                       WarningD (Warnings (getDEPRECATED_PRAGs $1) (fromOL $2))) [mo $1,mc $3] }
+
 decls_cls :: { Located ([AddAnn],OrdList (LHsDecl RdrName)) }  -- Reversed
           : decls_cls ';' decl_cls      {% if isNilOL (snd $ unLoc $1)
                                              then return (sLL $1 $> (mj AnnSemi $2:(fst $ unLoc $1)



More information about the ghc-commits mailing list