[Git][ghc/ghc][wip/T25266] Wibble assert in approximateWC
Simon Peyton Jones (@simonpj)
gitlab at gitlab.haskell.org
Sat Oct 12 19:40:58 UTC 2024
Simon Peyton Jones pushed to branch wip/T25266 at Glasgow Haskell Compiler / GHC
Commits:
72e4854d by Simon Peyton Jones at 2024-10-12T20:40:19+01:00
Wibble assert in approximateWC
- - - - -
2 changed files:
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Types/Constraint.hs
Changes:
=====================================
compiler/GHC/Tc/Solver.hs
=====================================
@@ -14,6 +14,7 @@ module GHC.Tc.Solver(
tcCheckGivens,
tcCheckWanteds,
tcNormalise,
+ approximateWC, -- Exported for plugins to use
captureTopConstraints,
=====================================
compiler/GHC/Tc/Types/Constraint.hs
=====================================
@@ -1823,8 +1823,11 @@ approximateWCX wc
float_ct :: Bool -> TcTyCoVarSet -> Ct
-> ApproxWC -> ApproxWC
float_ct encl_eqs skol_tvs ct acc@(quant, no_quant)
- | assertPpr (isWantedCt ct) (ppr ct) $ -- Only Wanteds expected here
- insolubleCt ct = acc
+ | isGivenCt ct = acc
+ -- There can be (insoluble) Given constraints in wc_simple,
+ -- there so that we get error reports for unreachable code
+ -- See `given_insols` in GHC.Tc.Solver.Solve.solveImplication
+ | insolubleCt ct = acc
| tyCoVarsOfCt ct `intersectsVarSet` skol_tvs = acc
| otherwise
= case classifyPredType (ctPred ct) of
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/72e4854d10332e789ca13dbb0bbfee38ec705253
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/72e4854d10332e789ca13dbb0bbfee38ec705253
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241012/2860ef8e/attachment-0001.html>
More information about the ghc-commits
mailing list