Commit ddde542d authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari
Browse files

DynFlags Remove -fwarn-context-quantification flag

As mentioned in #4426 these warnings are now errors since the Great
Wildcards Refactor of 2015 (1e041b73).
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
parent 05fe5463
......@@ -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
]
......
......@@ -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 *]
~~~~~~~~~~~~~~~~~~~~~
......
......@@ -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:
......
......@@ -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
......
{-# LANGUAGE RankNTypes #-}
{- # OPTIONS_GHC -fwarn-context-quantification #-}
module T4426 where
......
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’
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