[Git][ghc/ghc][wip/T25325] Wibbles

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Mon Oct 7 14:56:25 UTC 2024



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


Commits:
c15a7e65 by Simon Peyton Jones at 2024-10-07T15:56:12+01:00
Wibbles

- - - - -


2 changed files:

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


Changes:

=====================================
compiler/GHC/Tc/Errors.hs
=====================================
@@ -470,6 +470,8 @@ mkErrorItem ct
              flav = ctFlavour ct
 
        ; (suppress, m_evdest) <- case ctEvidence ct of
+         -- For this `suppress` stuff
+         -- see Note [Wanteds rewrite Wanteds] in GHC.Tc.Types.Constraint
            CtGiven {} -> return (False, Nothing)
            CtWanted { ctev_rewriters = rewriters, ctev_dest = dest }
              -> do { rewriters' <- zonkRewriterSet rewriters


=====================================
compiler/GHC/Tc/Types/Constraint.hs
=====================================
@@ -1444,13 +1444,13 @@ can't be solved.  But not quite all such constraints; see wrinkles.
    it looks only for IrredCt; all insoluble constraints oare put into
    CIrredCan
 
-(IW2) We only treat it as insoluble if it has an empty rewriter set.
-   Otherwise #25325 happens: a Wanted constraint A that is /not/ insoluble
-   rewrites some other Wanted constraint B, so B has A in its rewriter
-   set.  Now B looks insoluble.  The danger is that we'll suppress reporting
-   B becuase of its empty rewriter set; and suppress reporting A because
-   there is an insoluble B lying around.  (This suppression happens in
-   GHC.Tc.Errors.)  Solution: don't treat B as insoluble.
+(IW2) We only treat it as insoluble if it has an empty rewriter set.  (See Note
+   [Wanteds rewrite Wanteds].)  Otherwise #25325 happens: a Wanted constraint A
+   that is /not/ insoluble rewrites some other Wanted constraint B, so B has A
+   in its rewriter set.  Now B looks insoluble.  The danger is that we'll
+   suppress reporting B becuase of its empty rewriter set; and suppress
+   reporting A because there is an insoluble B lying around.  (This suppression
+   happens in GHC.Tc.Errors.mkErrorItem.)  Solution: don't treat B as insoluble.
 
 (IW3) If the Wanted arises from a Given (how can that happen?), don't
    treat it as a Wanted insoluble (obviously).



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c15a7e65259749663728e44d35ecbabd26b687f9

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


More information about the ghc-commits mailing list