summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/main/DynFlags.hs6
-rw-r--r--compiler/rename/RnTypes.hs4
-rw-r--r--docs/users_guide/glasgow_exts.rst4
-rw-r--r--docs/users_guide/using-warnings.rst26
-rw-r--r--testsuite/tests/rename/should_compile/T4426.hs1
-rw-r--r--testsuite/tests/rename/should_compile/T4426.stderr36
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’