diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 88668cb2a9ccccfbbb38a579469482e368b0fd87..4254efdaf2dd18f8071241bb5fd8044942dca00c 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 @-\@ flags can all be reversed with @-no-\@ 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 9f89afe0af45c1ff28ce1078e9cf7d9f619b6e2b..dee9055cf158406b5720550553e0db4e8e01ba8d 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 1ec1e890ee18767bd50bfe1d4484554509509314..0b2e90d36df5e1bbf00c86ed2f6c09e4cb2f0af4 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -1502,14 +1502,6 @@ - - - warn if there are any handwritten Typeable - instances (see ) - dynamic - - - diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index c825da90c7c4a1f946e9f73aa0e8d92e2bcdce26..735564d14b8be3ea6d9a20e7cb9d969d4e3f8831 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -3503,7 +3503,7 @@ See also . Also since GHC 7.8.1, handwritten (ie. not derived) instances of -Typeable are forbidden, and will be ignored with a warning. +Typeable are forbidden, and will result in an error. diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml index f6db2192a86a21cd19d589ceb303956d98402ce8..432276dc17ff00a708c1989b62a8c51c0f26ab25 100644 --- a/docs/users_guide/using.xml +++ b/docs/users_guide/using.xml @@ -974,7 +974,6 @@ test.hs:(5,4)-(6,7): , , , - , , and . The following flags are simple ways to select standard @@ -1739,19 +1738,6 @@ f "2" = 2 - - : - - - typeable instances, warning - - Report handwritten (ie. not derived) instances of the - Typeable class. These are ignore by the compiler; - only derived instances of Typeable are allowed. - - - - If you're feeling really paranoid, the