Commit 99cda8f6 authored by Alexis King's avatar Alexis King
Browse files

tc: Never quantify over special constraints

parent 7a9ca3e3
Pipeline #45040 passed with stages
in 241 minutes and 27 seconds
......@@ -19,7 +19,7 @@ module GHC.Core.Predicate (
mkHeteroPrimEqPred, mkHeteroReprPrimEqPred,
-- Special predicates
SpecialPred(..), specialPredTyCon,
SpecialPred(..), specialPredTyCon, isSpecialPredTyCon, isSpecialPred,
-- Class predicates
mkClassPred, isDictTy,
......@@ -220,6 +220,9 @@ instance Outputable SpecialPred where
specialPredTyCon :: SpecialPred -> TyCon
specialPredTyCon ConcretePrimPred = concretePrimTyCon
isSpecialPredTyCon :: TyCon -> Bool
isSpecialPredTyCon tc = tc `hasKey` concretePrimTyConKey
{-------------------------------------------
Predicates on PredType
--------------------------------------------}
......@@ -251,7 +254,7 @@ isEqPredClass :: Class -> Bool
isEqPredClass cls = cls `hasKey` eqTyConKey
|| cls `hasKey` heqTyConKey
isClassPred, isEqPred, isEqPrimPred :: PredType -> Bool
isClassPred, isEqPred, isEqPrimPred, isSpecialPred :: PredType -> Bool
isClassPred ty = case tyConAppTyCon_maybe ty of
Just tyCon | isClassTyCon tyCon -> True
_ -> False
......@@ -267,6 +270,10 @@ isEqPred ty -- True of (a ~ b) and (a ~~ b)
isEqPrimPred ty = isCoVarType ty
-- True of (a ~# b) (a ~R# b)
isSpecialPred ty = case tyConAppTyCon_maybe ty of
Just tc -> isSpecialPredTyCon tc
_ -> False
isCTupleClass :: Class -> Bool
isCTupleClass cls = isTupleTyCon (classTyCon cls)
......
......@@ -1097,7 +1097,9 @@ simplifyInfer rhs_tclvl infer_mode sigs name_taus wanteds
wanted_transformed = dropDerivedWC wanted_transformed_incl_derivs
quant_pred_candidates
| definite_error = []
| otherwise = ctsPreds (approximateWC False wanted_transformed)
| otherwise = filterOut isSpecialPred
$ ctsPreds
$ approximateWC False wanted_transformed
-- Decide what type variables and constraints to quantify
-- NB: quant_pred_candidates is already fully zonked
......
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