[Git][ghc/ghc][wip/T25266] Wibble assert in approximateWC

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Sat Oct 12 17:08:03 UTC 2024



Simon Peyton Jones pushed to branch wip/T25266 at Glasgow Haskell Compiler / GHC


Commits:
e56d336e by Simon Peyton Jones at 2024-10-12T18:07:43+01:00
Wibble assert in approximateWC

- - - - -


1 changed file:

- compiler/GHC/Tc/Types/Constraint.hs


Changes:

=====================================
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/e56d336ec069a13494e76a4cfe24c2faff0cfd4f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e56d336ec069a13494e76a4cfe24c2faff0cfd4f
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/bc5dc5b7/attachment-0001.html>


More information about the ghc-commits mailing list