diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2015-12-15 01:01:39 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-12-15 01:38:10 +0100 |
commit | ddde542dbcb088e0a10aa3cdc3e0aef0a1c4a9b7 (patch) | |
tree | 2d9ac299165ebc06578dc52d464602aa5f701f0a | |
parent | 05fe5463143769a2e84d5e3508a829792d5a1817 (diff) | |
download | haskell-ddde542dbcb088e0a10aa3cdc3e0aef0a1c4a9b7.tar.gz |
DynFlags Remove -fwarn-context-quantification flag
As mentioned in #4426 these warnings are now errors since the Great
Wildcards Refactor of 2015 (1e041b7382b6aa329e4ad9625439f811e0f27232).
I've opened #11221 to ensure we remove the last traces of the option in
8.2.
Test Plan: validate
Reviewers: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1615
GHC Trac Issues: #4426
-rw-r--r-- | compiler/main/DynFlags.hs | 6 | ||||
-rw-r--r-- | compiler/rename/RnTypes.hs | 4 | ||||
-rw-r--r-- | docs/users_guide/glasgow_exts.rst | 4 | ||||
-rw-r--r-- | docs/users_guide/using-warnings.rst | 26 | ||||
-rw-r--r-- | testsuite/tests/rename/should_compile/T4426.hs | 1 | ||||
-rw-r--r-- | testsuite/tests/rename/should_compile/T4426.stderr | 36 |
6 files changed, 27 insertions, 50 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 63cfe0338a..b306253538 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -504,7 +504,7 @@ data WarningFlag = | Opt_WarnUnusedPatternBinds | Opt_WarnUnusedImports | Opt_WarnUnusedMatches - | Opt_WarnContextQuantification + | Opt_WarnContextQuantification -- remove in 8.2 | Opt_WarnWarningsDeprecations | Opt_WarnDeprecatedFlags | Opt_WarnAMP -- Introduced in GHC 7.8, obsolete since 7.10 @@ -2904,7 +2904,8 @@ fWarningFlags = [ flagSpec "warn-dodgy-foreign-imports" Opt_WarnDodgyForeignImports, flagSpec "warn-dodgy-imports" Opt_WarnDodgyImports, flagSpec "warn-empty-enumerations" Opt_WarnEmptyEnumerations, - flagSpec "warn-context-quantification" Opt_WarnContextQuantification, + flagSpec' "warn-context-quantification" Opt_WarnContextQuantification + (\_ -> deprecate "it is subsumed by an error message that cannot be disabled"), flagSpec' "warn-duplicate-constraints" Opt_WarnDuplicateConstraints (\_ -> deprecate "it is subsumed by -fwarn-redundant-constraints"), flagSpec "warn-redundant-constraints" Opt_WarnRedundantConstraints, @@ -3473,7 +3474,6 @@ standardWarnings -- see Note [Documenting warning flags] Opt_WarnInlineRuleShadowing, Opt_WarnAlternativeLayoutRuleTransitional, Opt_WarnUnsupportedLlvmVersion, - Opt_WarnContextQuantification, Opt_WarnTabs ] diff --git a/compiler/rename/RnTypes.hs b/compiler/rename/RnTypes.hs index fef7b67000..4f7c291a89 100644 --- a/compiler/rename/RnTypes.hs +++ b/compiler/rename/RnTypes.hs @@ -264,8 +264,8 @@ f :: forall a. a -> b is an error f :: forall a. () => a -> b is an error f :: forall a. a -> (() => b) binds "a" and "b" -The -fwarn-context-quantification flag warns about -this situation. See rnHsTyKi for case HsForAllTy Qualified. +This situation is now considered to be an error. See rnHsTyKi for case +HsForAllTy Qualified. Note [Dealing with *] ~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 3c98dc71e1..ebe1f754e9 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -8379,8 +8379,8 @@ example: As of GHC 7.10, this is deprecated. The ``-fwarn-context-quantification`` flag detects this situation and issues -a warning. In GHC 7.12, declarations such as ``MkSwizzle'`` will cause -an out-of-scope error. +a warning. In GHC 8.0 this flag was deprecated and declarations such as +``MkSwizzle'`` will cause an out-of-scope error. As for type signatures, implicit quantification happens for non-overloaded types too. So if you write this: diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 9b986864e8..699c8fd2a4 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -19,9 +19,8 @@ generally likely to indicate bugs in your program. These are: ``-fwarn-missing-methods``, ``-fwarn-wrong-do-bind``, ``-fwarn-unsupported-calling-conventions``, ``-fwarn-dodgy-foreign-imports``, ``-fwarn-inline-rule-shadowing``, -``-fwarn-unsupported-llvm-version``, ``-fwarn-context-quantification``, -and ``-fwarn-tabs``. The following flags are simple ways to select -standard “packages” of warnings: +``-fwarn-unsupported-llvm-version`` and ``-fwarn-tabs``. The following flags are +simple ways to select standard “packages” of warnings: ``-W`` .. index:: @@ -894,27 +893,6 @@ command line. do { mapM_ popInt xs ; return 10 } -``-fwarn-context-quantification`` - .. index:: - single: -fwarn-context-quantification - single: implicit context quantification, warning - single: context, implicit quantification - - Report if a variable is quantified only due to its presence in a - context (see :ref:`universal-quantification`). For example, - - :: - - type T a = Monad m => a -> f a - - It is recommended to write this polymorphic type as - - :: - - type T a = forall m. Monad m => a -> f a - - instead. - ``-fwarn-wrong-do-bind`` .. index:: single: -fwarn-wrong-do-bind diff --git a/testsuite/tests/rename/should_compile/T4426.hs b/testsuite/tests/rename/should_compile/T4426.hs index 610f670e44..49e58751bd 100644 --- a/testsuite/tests/rename/should_compile/T4426.hs +++ b/testsuite/tests/rename/should_compile/T4426.hs @@ -1,5 +1,4 @@ {-# LANGUAGE RankNTypes #-} -{- # OPTIONS_GHC -fwarn-context-quantification #-} module T4426 where diff --git a/testsuite/tests/rename/should_compile/T4426.stderr b/testsuite/tests/rename/should_compile/T4426.stderr index f731f3544d..0d0b70628c 100644 --- a/testsuite/tests/rename/should_compile/T4426.stderr +++ b/testsuite/tests/rename/should_compile/T4426.stderr @@ -1,18 +1,18 @@ -
-T4426.hs:11:18: error: Not in scope: type variable ‘m’
-
-T4426.hs:11:28: error: Not in scope: type variable ‘m’
-
-T4426.hs:13:18: error: Not in scope: type variable ‘b’
-
-T4426.hs:13:28: error: Not in scope: type variable ‘b’
-
-T4426.hs:15:24: error: Not in scope: type variable ‘b’
-
-T4426.hs:15:34: error: Not in scope: type variable ‘b’
-
-T4426.hs:15:39: error: Not in scope: type variable ‘c’
-
-T4426.hs:17:23: error: Not in scope: type variable ‘m’
-
-T4426.hs:17:28: error: Not in scope: type variable ‘m’
+ +T4426.hs:10:18: error: Not in scope: type variable ‘m’ + +T4426.hs:10:28: error: Not in scope: type variable ‘m’ + +T4426.hs:12:18: error: Not in scope: type variable ‘b’ + +T4426.hs:12:28: error: Not in scope: type variable ‘b’ + +T4426.hs:14:24: error: Not in scope: type variable ‘b’ + +T4426.hs:14:34: error: Not in scope: type variable ‘b’ + +T4426.hs:14:39: error: Not in scope: type variable ‘c’ + +T4426.hs:16:23: error: Not in scope: type variable ‘m’ + +T4426.hs:16:28: error: Not in scope: type variable ‘m’ |