summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/GHC/Tc/Instance/FunDeps.hs6
-rw-r--r--compiler/GHC/Tc/Solver.hs2
2 files changed, 5 insertions, 3 deletions
diff --git a/compiler/GHC/Tc/Instance/FunDeps.hs b/compiler/GHC/Tc/Instance/FunDeps.hs
index e3baf4c4f9..5b215490af 100644
--- a/compiler/GHC/Tc/Instance/FunDeps.hs
+++ b/compiler/GHC/Tc/Instance/FunDeps.hs
@@ -44,7 +44,6 @@ import GHC.Utils.FV
import GHC.Utils.Error( Validity'(..), Validity, allValid )
import GHC.Utils.Misc
import GHC.Utils.Panic
-import GHC.Utils.Panic.Plain ( assert )
import GHC.Data.Pair ( Pair(..) )
import Data.List ( nubBy )
@@ -552,7 +551,10 @@ closeWrtFunDeps :: [PredType] -> TyCoVarSet -> TyCoVarSet
-- See Note [The liberal coverage condition]
closeWrtFunDeps preds fixed_tvs
| null tv_fds = fixed_tvs -- Fast escape hatch for common case.
- | otherwise = assert (closeOverKinds fixed_tvs == fixed_tvs)
+ | otherwise = assertPpr (closeOverKinds fixed_tvs == fixed_tvs)
+ (vcat [ text "closeWrtFunDeps: fixed_tvs is not closed over kinds"
+ , text "fixed_tvs:" <+> ppr fixed_tvs
+ , text "closure:" <+> ppr (closeOverKinds fixed_tvs) ])
$ fixVarSet extend fixed_tvs
where
diff --git a/compiler/GHC/Tc/Solver.hs b/compiler/GHC/Tc/Solver.hs
index 1ea5ba7de1..31e2f7ed93 100644
--- a/compiler/GHC/Tc/Solver.hs
+++ b/compiler/GHC/Tc/Solver.hs
@@ -1672,7 +1672,7 @@ decideMonoTyVars infer_mode name_taus psigs candidates
; tc_lvl <- TcM.getTcLevel
; let psig_tys = mkTyVarTys psig_qtvs ++ psig_theta
- co_vars = coVarsOfTypes (psig_tys ++ taus)
+ co_vars = coVarsOfTypes (psig_tys ++ taus ++ candidates)
co_var_tvs = closeOverKinds co_vars
-- The co_var_tvs are tvs mentioned in the types of covars or
-- coercion holes. We can't quantify over these covars, so we