Commit 9fb15842 authored by jpm@cs.ox.ac.uk's avatar jpm@cs.ox.ac.uk

Remove -fwarn-typeable-instances

parent 2cec084e
...@@ -451,7 +451,6 @@ data WarningFlag = ...@@ -451,7 +451,6 @@ data WarningFlag =
| Opt_WarnUnsupportedCallingConventions | Opt_WarnUnsupportedCallingConventions
| Opt_WarnUnsupportedLlvmVersion | Opt_WarnUnsupportedLlvmVersion
| Opt_WarnInlineRuleShadowing | Opt_WarnInlineRuleShadowing
| Opt_WarnTypeableInstances
deriving (Eq, Show, Enum) deriving (Eq, Show, Enum)
data Language = Haskell98 | Haskell2010 data Language = Haskell98 | Haskell2010
...@@ -2506,8 +2505,7 @@ fWarningFlags = [ ...@@ -2506,8 +2505,7 @@ fWarningFlags = [
( "warn-pointless-pragmas", Opt_WarnPointlessPragmas, nop ), ( "warn-pointless-pragmas", Opt_WarnPointlessPragmas, nop ),
( "warn-unsupported-calling-conventions", Opt_WarnUnsupportedCallingConventions, nop ), ( "warn-unsupported-calling-conventions", Opt_WarnUnsupportedCallingConventions, nop ),
( "warn-inline-rule-shadowing", Opt_WarnInlineRuleShadowing, nop ), ( "warn-inline-rule-shadowing", Opt_WarnInlineRuleShadowing, nop ),
( "warn-unsupported-llvm-version", Opt_WarnUnsupportedLlvmVersion, nop ), ( "warn-unsupported-llvm-version", Opt_WarnUnsupportedLlvmVersion, nop ) ]
( "warn-typeable-instances", Opt_WarnTypeableInstances, nop ) ]
-- | These @-\<blah\>@ flags can all be reversed with @-no-\<blah\>@ -- | These @-\<blah\>@ flags can all be reversed with @-no-\<blah\>@
negatableFlags :: [FlagSpec GeneralFlag] negatableFlags :: [FlagSpec GeneralFlag]
...@@ -2918,7 +2916,6 @@ standardWarnings ...@@ -2918,7 +2916,6 @@ standardWarnings
Opt_WarnWrongDoBind, Opt_WarnWrongDoBind,
Opt_WarnUnsupportedCallingConventions, Opt_WarnUnsupportedCallingConventions,
Opt_WarnDodgyForeignImports, Opt_WarnDodgyForeignImports,
Opt_WarnTypeableInstances,
Opt_WarnInlineRuleShadowing, Opt_WarnInlineRuleShadowing,
Opt_WarnAlternativeLayoutRuleTransitional, Opt_WarnAlternativeLayoutRuleTransitional,
Opt_WarnUnsupportedLlvmVersion Opt_WarnUnsupportedLlvmVersion
......
...@@ -406,14 +406,13 @@ tcInstDecls1 tycl_decls inst_decls deriv_decls ...@@ -406,14 +406,13 @@ tcInstDecls1 tycl_decls inst_decls deriv_decls
; return (gbl_env, emptyBag, emptyValBindsOut) } ; return (gbl_env, emptyBag, emptyValBindsOut) }
else tcDeriving tycl_decls inst_decls deriv_decls else tcDeriving tycl_decls inst_decls deriv_decls
-- Remove any handwritten instance of poly-kinded Typeable and warn -- Fail if there are any handwritten instance of poly-kinded Typeable
; dflags <- getDynFlags ; mapM_ (failWithTc . instMsg) typeable_instances
; when (wopt Opt_WarnTypeableInstances dflags) $
mapM_ (failWithTc . instMsg) typeable_instances
-- Check that if the module is compiled with -XSafe, there are no -- Check that if the module is compiled with -XSafe, there are no
-- hand written instances of old Typeable as then unsafe casts could be -- hand written instances of old Typeable as then unsafe casts could be
-- performed. Derived instances are OK. -- performed. Derived instances are OK.
; dflags <- getDynFlags
; when (safeLanguageOn dflags) $ ; when (safeLanguageOn dflags) $
mapM_ (\x -> when (typInstCheck x) mapM_ (\x -> when (typInstCheck x)
(addErrAt (getSrcSpan $ iSpec x) typInstErr)) (addErrAt (getSrcSpan $ iSpec x) typInstErr))
......
...@@ -1502,14 +1502,6 @@ ...@@ -1502,14 +1502,6 @@
<entry><option>-fno-warn-warnings-deprecations</option></entry> <entry><option>-fno-warn-warnings-deprecations</option></entry>
</row> </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> </tbody>
</tgroup> </tgroup>
</informaltable> </informaltable>
......
...@@ -3503,7 +3503,7 @@ See also <xref linkend="auto-derive-typeable"/>. ...@@ -3503,7 +3503,7 @@ See also <xref linkend="auto-derive-typeable"/>.
</para> </para>
<para> <para>
Also since GHC 7.8.1, handwritten (ie. not derived) instances of 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> </para>
</listitem> </listitem>
......
...@@ -974,7 +974,6 @@ test.hs:(5,4)-(6,7): ...@@ -974,7 +974,6 @@ test.hs:(5,4)-(6,7):
<option>-fwarn-wrong-do-bind</option>, <option>-fwarn-wrong-do-bind</option>,
<option>-fwarn-unsupported-calling-conventions</option>, <option>-fwarn-unsupported-calling-conventions</option>,
<option>-fwarn-dodgy-foreign-imports</option>, <option>-fwarn-dodgy-foreign-imports</option>,
<option>-fwarn-typeable-instances</option>,
<option>-fwarn-inline-rule-shadowing</option>, and <option>-fwarn-inline-rule-shadowing</option>, and
<option>-fwarn-unsupported-llvm-version</option>. <option>-fwarn-unsupported-llvm-version</option>.
The following flags are simple ways to select standard The following flags are simple ways to select standard
...@@ -1739,19 +1738,6 @@ f "2" = 2 ...@@ -1739,19 +1738,6 @@ f "2" = 2
</listitem> </listitem>
</varlistentry> </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> </variablelist>
<para>If you're feeling really paranoid, the <para>If you're feeling really paranoid, the
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment