Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alexis King
GHC
Commits
99cda8f6
Commit
99cda8f6
authored
Dec 09, 2021
by
Alexis King
Browse files
tc: Never quantify over special constraints
parent
7a9ca3e3
Pipeline
#45040
passed with stages
in 241 minutes and 27 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
compiler/GHC/Core/Predicate.hs
View file @
99cda8f6
...
...
@@ -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
)
...
...
compiler/GHC/Tc/Solver.hs
View file @
99cda8f6
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment