[Git][ghc/ghc][wip/T27844] Switch off `do_not_prevent_rewriting` to see why it is useful
Simon Peyton Jones pushed to branch wip/T27844 at Glasgow Haskell Compiler / GHC Commits: 4f82c588 by Simon Peyton Jones at 2026-09-28T07:59:40+01:00 Switch off `do_not_prevent_rewriting` to see why it is useful - - - - - 1 changed file: - compiler/GHC/Tc/Solver/Equality.hs Changes: ===================================== compiler/GHC/Tc/Solver/Equality.hs ===================================== @@ -2291,6 +2291,7 @@ canEqCanLHSFinish_no_unification ev eq_rel swapped lhs rhs ; check_result <- checkTypeEq ev eq_rel lhs rhs ; case check_result of PuFail reason +{- | reason `cterHasOnlyProblems` do_not_prevent_rewriting -> do { new_ev <- rewriteEqEvidenceSwapOnly ev eq_rel swapped lhs rhs ; continueWith $ Right $ @@ -2298,6 +2299,7 @@ canEqCanLHSFinish_no_unification ev eq_rel swapped lhs rhs , eq_lhs = lhs , eq_rhs = rhs } } | otherwise +-} -> -- We can't unify, and this equality should not be used to rewrite -- other constraints (e.g. because it has an occurs check). -- So add it to the inert Irreds. @@ -2328,6 +2330,7 @@ canEqCanLHSFinish_no_unification ev eq_rel swapped lhs rhs , eq_lhs = lhs , eq_rhs = reductionReducedType rhs_redn } } } +{- -- | Some problems prevent /unification/ but not /rewriting/: -- -- Skolem-escape: if we have [W] alpha[2] ~ Maybe b[3] @@ -2339,6 +2342,8 @@ canEqCanLHSFinish_no_unification ev eq_rel swapped lhs rhs do_not_prevent_rewriting :: CheckTyEqResult do_not_prevent_rewriting = cteProblem cteSkolemEscape S.<> cteProblem cteConcrete +-} + ---------------------- finishCanWithIrred :: CtIrredReason -> CtEvidence -> TcS (StopOrContinue (Either IrredCt a)) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4f82c588e8cfcf0540006d5c65327322... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4f82c588e8cfcf0540006d5c65327322... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Simon Peyton Jones (@simonpj)