summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/Solver/Canonical.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Tc/Solver/Canonical.hs')
-rw-r--r--compiler/GHC/Tc/Solver/Canonical.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/GHC/Tc/Solver/Canonical.hs b/compiler/GHC/Tc/Solver/Canonical.hs
index e07f2a4633..db1c3c1652 100644
--- a/compiler/GHC/Tc/Solver/Canonical.hs
+++ b/compiler/GHC/Tc/Solver/Canonical.hs
@@ -871,6 +871,10 @@ solveForAll :: CtEvidence -> [TyVar] -> TcThetaType -> PredType -> Bool
solveForAll ev tvs theta pred pend_sc
| CtWanted { ctev_dest = dest } <- ev
= -- See Note [Solving a Wanted forall-constraint]
+ setLclEnv (ctLocEnv loc) $
+ -- This setLclEnv is important: the emitImplicationTcS uses that
+ -- TcLclEnv for the implication, and that in turn sets the location
+ -- for the Givens when solving the constraint (#21006)
do { let skol_info = QuantCtxtSkol
empty_subst = mkEmptyTCvSubst $ mkInScopeSet $
tyCoVarsOfTypes (pred:theta) `delVarSetList` tvs