Simon Peyton Jones pushed to branch wip/T23162-part2 at Glasgow Haskell Compiler / GHC Commits: d74825b9 by Simon Peyton Jones at 2025-12-08T10:28:57+00:00 Wibble - - - - - 2 changed files: - compiler/GHC/Tc/Errors.hs - compiler/GHC/Tc/Errors/Types.hs Changes: ===================================== compiler/GHC/Tc/Errors.hs ===================================== @@ -648,6 +648,7 @@ reportWanteds ctxt tc_lvl wc@(WC { wc_simple = simples, wc_impl = implics , ("Homo eqs", is_homo_equality, True, mkGroupReporter mkEqErr) , ("Other eqs", is_equality, True, mkGroupReporter mkEqErr) + , ("Insoluble fundeps", is_insoluble_fundep, True, mkGroupReporter mkDictErr) ] -- report2: we suppress these if there are insolubles elsewhere in the tree @@ -665,6 +666,11 @@ reportWanteds ctxt tc_lvl wc@(WC { wc_simple = simples, wc_impl = implics | otherwise = False -- I think all given residuals are equalities + -- Constraints that have insoluble functional dependencies + is_insoluble_fundep item _ = case ei_m_reason item of + Just InsolubleFunDepReason -> True + _ -> False + -- Things like (Int ~N Bool) utterly_wrong _ (EqPred NomEq ty1 ty2) = isRigidTy ty1 && isRigidTy ty2 utterly_wrong _ _ = False ===================================== compiler/GHC/Tc/Errors/Types.hs ===================================== @@ -5423,7 +5423,7 @@ getUserGivens (CEC {cec_encl = implics}) = getUserGivensFromImplics implics -- that will give rise to a diagnostic. data ErrorItem -- We could perhaps use Ct here (and indeed used to do exactly that), but --- having a separate type gives to denote errors-in-formation gives us +-- having a separate type to denote error-information gives us -- a nice place to do pre-processing, such as calculating ei_suppress. -- Perhaps some day, an ErrorItem could eventually evolve to contain -- the error text (or some representation of it), so we can then have all @@ -5436,7 +5436,7 @@ data ErrorItem -- for Givens, Nothing , ei_flavour :: CtFlavour , ei_loc :: CtLoc - , ei_m_reason :: Maybe CtIrredReason -- if this ErrorItem was made from a + , ei_m_reason :: Maybe CtIrredReason -- If this ErrorItem was made from a -- CtIrred, this stores the reason , ei_suppress :: Bool -- Suppress because of -- Note [Wanteds rewrite Wanteds: rewriter-sets] View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d74825b92948117f73814ea0457b9994... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d74825b92948117f73814ea0457b9994... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Simon Peyton Jones (@simonpj)