Remove -fwarn-typeable-instances
authorJose Pedro Magalhaes <jpm@cs.ox.ac.uk>
Mon, 9 Sep 2013 10:31:59 +0000 (11:31 +0100)
committerJose Pedro Magalhaes <jpm@cs.ox.ac.uk>
Mon, 9 Sep 2013 10:31:59 +0000 (11:31 +0100)
compiler/main/DynFlags.hs
compiler/typecheck/TcInstDcls.lhs
docs/users_guide/flags.xml
docs/users_guide/glasgow_exts.xml
docs/users_guide/using.xml

index 88668cb..4254efd 100644 (file)
@@ -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
index 9f89afe..dee9055 100644 (file)
@@ -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))
index 1ec1e89..0b2e90d 100644 (file)
             <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>
index c825da9..735564d 100644 (file)
@@ -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>
 
index f6db219..432276d 100644 (file)
@@ -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