Commit 0bdafd5c authored by Simon Peyton Jones's avatar Simon Peyton Jones

ConstraintKind -> ConstraintKinds

parent 80d19632
......@@ -383,7 +383,7 @@ data ExtensionFlag
| Opt_NPlusKPatterns
| Opt_DoAndIfThenElse
| Opt_RebindableSyntax
| Opt_ConstraintKind
| Opt_ConstraintKinds
| Opt_StandaloneDeriving
| Opt_DeriveDataTypeable
......@@ -1862,7 +1862,7 @@ xFlags = [
( "NPlusKPatterns", AlwaysAllowed, Opt_NPlusKPatterns, nop ),
( "DoAndIfThenElse", AlwaysAllowed, Opt_DoAndIfThenElse, nop ),
( "RebindableSyntax", AlwaysAllowed, Opt_RebindableSyntax, nop ),
( "ConstraintKind", AlwaysAllowed, Opt_ConstraintKind, nop ),
( "ConstraintKinds", AlwaysAllowed, Opt_ConstraintKinds, nop ),
( "MonoPatBinds", AlwaysAllowed, Opt_MonoPatBinds,
\ turn_on -> when turn_on $ deprecate "Experimental feature now removed; has no effect" ),
( "ExplicitForAll", AlwaysAllowed, Opt_ExplicitForAll, nop ),
......
......@@ -787,12 +787,12 @@ checkDoAndIfThenElse guardExpr semiThen thenExpr semiElse elseExpr
checkKindName :: Located FastString -> P (Located Kind)
checkKindName (L l fs) = do
pState <- getPState
let ext_enabled = xopt Opt_ConstraintKind (dflags pState)
let ext_enabled = xopt Opt_ConstraintKinds (dflags pState)
is_kosher = fs == occNameFS (nameOccName constraintKindTyConName)
if not ext_enabled || not is_kosher
then parseErrorSDoc l (text "Unexpected named kind:"
$$ nest 4 (ppr fs)
$$ if (not ext_enabled && is_kosher) then text "Perhaps you meant to use -XConstraintKind?" else empty)
$$ if (not ext_enabled && is_kosher) then text "Perhaps you meant to use -XConstraintKinds?" else empty)
else return (L l constraintKind)
\end{code}
......
......@@ -50,7 +50,7 @@ import NameSet
import TysWiredIn
import BasicTypes
import SrcLoc
import DynFlags ( ExtensionFlag(Opt_ConstraintKind) )
import DynFlags ( ExtensionFlag( Opt_ConstraintKinds ) )
import Util
import UniqSupply
import Outputable
......@@ -373,7 +373,7 @@ kc_hs_type (HsKindSig ty k) = do
return (HsKindSig ty' k, k)
kc_hs_type (HsTupleTy (HsBoxyTuple _) tys) = do
fact_tup_ok <- xoptM Opt_ConstraintKind
fact_tup_ok <- xoptM Opt_ConstraintKinds
if not fact_tup_ok
then do tys' <- mapM kcLiftedType tys
return (HsTupleTy (HsBoxyTuple liftedTypeKind) tys', liftedTypeKind)
......
......@@ -1155,10 +1155,10 @@ check_pred_ty' _ _ctxt (IPPred _ ty) = checkValidMonoType ty
-- Happily this is not an issue in the new constraint solver.
check_pred_ty' dflags ctxt t@(TuplePred ts)
= do { checkTc (xopt Opt_ConstraintKind dflags)
= do { checkTc (xopt Opt_ConstraintKinds dflags)
(predTupleErr (predTreePredType t))
; mapM_ (check_pred_ty' dflags ctxt) ts }
-- This case will not normally be executed because without ConstraintKind
-- This case will not normally be executed because without -XConstraintKinds
-- tuple types are only kind-checked as *
check_pred_ty' dflags ctxt (IrredPred pred)
......@@ -1178,7 +1178,7 @@ check_pred_ty' dflags ctxt (IrredPred pred)
--
-- In both cases it's OK if the predicate is actually a synonym, though.
-- We'll also allow it if
= do checkTc (xopt Opt_ConstraintKind dflags)
= do checkTc (xopt Opt_ConstraintKinds dflags)
(predIrredErr pred)
case tcView pred of
Just pred' ->
......@@ -1338,9 +1338,9 @@ eqPredTyErr pred = ptext (sLit "Illegal equational constraint") <+> pprType pre
predTyVarErr pred = sep [ptext (sLit "Non type-variable argument"),
nest 2 (ptext (sLit "in the constraint:") <+> pprType pred)]
predTupleErr pred = ptext (sLit "Illegal tuple constraint") <+> pprType pred $$
parens (ptext (sLit "Use -XConstraintKind to permit this"))
parens (ptext (sLit "Use -XConstraintKinds to permit this"))
predIrredErr pred = ptext (sLit "Illegal irreducible constraint") <+> pprType pred $$
parens (ptext (sLit "Use -XConstraintKind to permit this"))
parens (ptext (sLit "Use -XConstraintKinds to permit this"))
predIrredBadCtxtErr pred = ptext (sLit "Illegal irreducible constraint") <+> pprType pred $$
ptext (sLit "in superclass/instance head context") <+>
parens (ptext (sLit "Use -XUndecidableInstances to permit this"))
......
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