[commit: ghc] master: Remove -fwarn-typeable-instances (9fb1584)

git at git.haskell.org git at git.haskell.org
Mon Sep 9 12:32:16 CEST 2013


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

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

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

commit 9fb15842df6f3db7598b11843c33f761fb44ea87
Author: Jose Pedro Magalhaes <jpm at cs.ox.ac.uk>
Date:   Mon Sep 9 11:31:59 2013 +0100

    Remove -fwarn-typeable-instances


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

9fb15842df6f3db7598b11843c33f761fb44ea87
 compiler/main/DynFlags.hs         |    5 +----
 compiler/typecheck/TcInstDcls.lhs |    7 +++----
 docs/users_guide/flags.xml        |    8 --------
 docs/users_guide/glasgow_exts.xml |    2 +-
 docs/users_guide/using.xml        |   14 --------------
 5 files changed, 5 insertions(+), 31 deletions(-)

diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 88668cb..4254efd 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -451,7 +451,6 @@ data WarningFlag =
    | Opt_WarnUnsupportedCallingConventions
    | Opt_WarnUnsupportedLlvmVersion
    | Opt_WarnInlineRuleShadowing
-   | Opt_WarnTypeableInstances
    deriving (Eq, Show, Enum)
 
 data Language = Haskell98 | Haskell2010
@@ -2506,8 +2505,7 @@ fWarningFlags = [
   ( "warn-pointless-pragmas",           Opt_WarnPointlessPragmas, nop ),
   ( "warn-unsupported-calling-conventions", Opt_WarnUnsupportedCallingConventions, nop ),
   ( "warn-inline-rule-shadowing",       Opt_WarnInlineRuleShadowing, nop ),
-  ( "warn-unsupported-llvm-version",    Opt_WarnUnsupportedLlvmVersion, nop ),
-  ( "warn-typeable-instances",          Opt_WarnTypeableInstances, nop ) ]
+  ( "warn-unsupported-llvm-version",    Opt_WarnUnsupportedLlvmVersion, nop ) ]
 
 -- | These @-\<blah\>@ flags can all be reversed with @-no-\<blah\>@
 negatableFlags :: [FlagSpec GeneralFlag]
@@ -2918,7 +2916,6 @@ standardWarnings
         Opt_WarnWrongDoBind,
         Opt_WarnUnsupportedCallingConventions,
         Opt_WarnDodgyForeignImports,
-        Opt_WarnTypeableInstances,
         Opt_WarnInlineRuleShadowing,
         Opt_WarnAlternativeLayoutRuleTransitional,
         Opt_WarnUnsupportedLlvmVersion
diff --git a/compiler/typecheck/TcInstDcls.lhs b/compiler/typecheck/TcInstDcls.lhs
index 9f89afe..dee9055 100644
--- a/compiler/typecheck/TcInstDcls.lhs
+++ b/compiler/typecheck/TcInstDcls.lhs
@@ -406,14 +406,13 @@ tcInstDecls1 tycl_decls inst_decls deriv_decls
                          ; return (gbl_env, emptyBag, emptyValBindsOut) }
                  else tcDeriving tycl_decls inst_decls deriv_decls
 
-       -- Remove any handwritten instance of poly-kinded Typeable and warn
-       ; dflags <- getDynFlags
-       ; when (wopt Opt_WarnTypeableInstances dflags) $
-              mapM_ (failWithTc . instMsg) typeable_instances
+       -- Fail if there are any handwritten instance of poly-kinded Typeable
+       ; mapM_ (failWithTc . instMsg) typeable_instances
 
        -- Check that if the module is compiled with -XSafe, there are no
        -- hand written instances of old Typeable as then unsafe casts could be
        -- performed. Derived instances are OK.
+       ; dflags <- getDynFlags
        ; when (safeLanguageOn dflags) $
              mapM_ (\x -> when (typInstCheck x)
                                (addErrAt (getSrcSpan $ iSpec x) typInstErr))
diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml
index 1ec1e89..0b2e90d 100644
--- a/docs/users_guide/flags.xml
+++ b/docs/users_guide/flags.xml
@@ -1502,14 +1502,6 @@
             <entry><option>-fno-warn-warnings-deprecations</option></entry>
           </row>
 
-          <row>
-            <entry><option>-fwarn-typeable-instances</option></entry>
-            <entry>warn if there are any handwritten <literal>Typeable</literal>
-                   instances (see <xref linkend="deriving-typeable"/>)</entry>
-            <entry>dynamic</entry>
-            <entry><option>-fno-warn-typeable-instances</option></entry>
-          </row>
-
         </tbody>
       </tgroup>
     </informaltable>
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index c825da9..735564d 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -3503,7 +3503,7 @@ See also <xref linkend="auto-derive-typeable"/>.
 </para>
 <para>
 Also since GHC 7.8.1, handwritten (ie. not derived) instances of
-<literal>Typeable</literal> are forbidden, and will be ignored with a warning.
+<literal>Typeable</literal> are forbidden, and will result in an error.
 </para>
 </listitem>
 
diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml
index f6db219..432276d 100644
--- a/docs/users_guide/using.xml
+++ b/docs/users_guide/using.xml
@@ -974,7 +974,6 @@ test.hs:(5,4)-(6,7):
     <option>-fwarn-wrong-do-bind</option>,
     <option>-fwarn-unsupported-calling-conventions</option>,
     <option>-fwarn-dodgy-foreign-imports</option>,
-    <option>-fwarn-typeable-instances</option>,
     <option>-fwarn-inline-rule-shadowing</option>, and
     <option>-fwarn-unsupported-llvm-version</option>.
     The following flags are simple ways to select standard
@@ -1739,19 +1738,6 @@ f "2"    = 2
         </listitem>
       </varlistentry>
 
-      <varlistentry>
-        <term><option>-fwarn-typeable-instances</option>:</term>
-        <listitem>
-          <indexterm><primary><option>-fwarn-typeable-instances</option></primary></indexterm>
-          <indexterm><primary>typeable instances, warning</primary></indexterm>
-
-          <para>Report handwritten (ie. not derived) instances of the
-          <literal>Typeable</literal> class. These are ignore by the compiler;
-          only derived instances of <literal>Typeable</literal> are allowed.
-          </para>
-        </listitem>
-      </varlistentry>
-
     </variablelist>
 
     <para>If you're feeling really paranoid, the





More information about the ghc-commits mailing list