[Git][ghc/ghc][wip/issue-23832] Apply 3 suggestion(s) to 3 file(s)

Gergő Érdi (@cactus) gitlab at gitlab.haskell.org
Mon Aug 21 01:57:28 UTC 2023



Gergő Érdi pushed to branch wip/issue-23832 at Glasgow Haskell Compiler / GHC


Commits:
bc28c6b0 by sheaf at 2023-08-21T01:57:25+00:00
Apply 3 suggestion(s) to 3 file(s)
- - - - -


3 changed files:

- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Solver.hs


Changes:

=====================================
compiler/GHC/Tc/Errors/Ppr.hs
=====================================
@@ -1858,6 +1858,7 @@ instance Diagnostic TcRnMessage where
       vcat [ text "Defaulting plugin returned invalid defaulting proposal."
            , hang (text "Type variables:") 2 $ ppr tvs
            , hang (text "Proposed types:") 2 $ ppr tys
+           , text "The lists have different lengths."
            ]
 
   diagnosticReason = \case


=====================================
compiler/GHC/Tc/Errors/Types.hs
=====================================
@@ -4123,8 +4123,9 @@ data TcRnMessage where
   TcRnIllegalTypeExpr :: TcRnMessage
 
   {-| TcRnMisalignedDefaultingProposal is an error raised when a
-      defaulting plugin returns a defaulting proposal with the list of
-      default types not matching the list of type variables.
+      defaulting plugin returns a defaulting proposal in which the list of
+      default types has a different length than the list of type variables
+      to default.
 
       Test cases:
         T23832_misaligned


=====================================
compiler/GHC/Tc/Solver.hs
=====================================
@@ -3705,6 +3705,8 @@ disambigMultiGroup defaults the_tvs wanteds = anyM propose defaults
   where
     propose default_tys
         = do { traceTcS "disambigMultiGroup {" (vcat [ ppr default_tys, ppr the_tvs, ppr wanteds ])
+             -- Only with a defaulting plugin could these lengths be mismatched.
+             -- We report an error, instead of silently failing to default.
              ; unless (equalLength the_tvs default_tys) $
                  failTcS $ TcRnMisalignedDefaultingProposal the_tvs default_tys
              ; fake_ev_binds_var <- TcS.newTcEvBinds



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

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


More information about the ghc-commits mailing list