Deprecate -XGenerics.
authorJose Pedro Magalhaes <jpm@cs.uu.nl>
Mon, 9 May 2011 09:02:42 +0000 (11:02 +0200)
committerJose Pedro Magalhaes <jpm@cs.uu.nl>
Mon, 9 May 2011 09:02:42 +0000 (11:02 +0200)
compiler/main/DynFlags.hs
compiler/typecheck/TcDeriv.lhs

index ea10993..873b846 100644 (file)
@@ -343,8 +343,8 @@ data ExtensionFlag
    | Opt_DeriveTraversable
    | Opt_DeriveFoldable
    | Opt_DeriveGeneric            -- Allow deriving Generic/1
-   | Opt_DefaultSignatures              -- Allow extra signatures for defmeths
-   | Opt_Generics                       -- Generic deriving mechanism
+   | Opt_DefaultSignatures        -- Allow extra signatures for defmeths
+   | Opt_Generics                 -- Old generic classes, now deprecated
 
    | Opt_TypeSynonymInstances
    | Opt_FlexibleContexts
@@ -1640,7 +1640,8 @@ xFlags = [
   ( "ParallelArrays",                   Opt_ParallelArrays, nop ),
   ( "TemplateHaskell",                  Opt_TemplateHaskell, checkTemplateHaskellOk ),
   ( "QuasiQuotes",                      Opt_QuasiQuotes, nop ),
-  ( "Generics",                         Opt_Generics, nop ),
+  ( "Generics",                         Opt_Generics,
+    \ _ -> deprecate "it does nothing; look into -XDefaultSignatures and -XDeriveGeneric for generic programming support." ),
   ( "ImplicitPrelude",                  Opt_ImplicitPrelude, nop ),
   ( "RecordWildCards",                  Opt_RecordWildCards, nop ),
   ( "NamedFieldPuns",                   Opt_RecordPuns, nop ),
@@ -1749,9 +1750,6 @@ impliedFlags
     , (Opt_RecordWildCards,     turnOn, Opt_DisambiguateRecordFields)
     
     , (Opt_ParallelArrays, turnOn, Opt_ParallelListComp)
-    -- The new behavior of the XGenerics flag is just to turn on these two flags
-    , (Opt_Generics, turnOn, Opt_DefaultSignatures)
-    , (Opt_Generics, turnOn, Opt_DeriveGeneric)
   ]
 
 optLevelFlags :: [([Int], DynFlag)]
index ffd7bac..4d80631 100644 (file)
@@ -940,8 +940,7 @@ sideConditions mtheta cls
   | cls_key == traversableClassKey = Just (checkFlag Opt_DeriveTraversable `andCond`
                                           cond_functorOK False)
   | cls_key == genClassKey         = Just (cond_RepresentableOk `andCond`
-                                           (checkFlag Opt_DeriveGeneric `orCond`
-                                            checkFlag Opt_Generics))
+                                           checkFlag Opt_DeriveGeneric)
   | otherwise = Nothing
   where
     cls_key = getUnique cls