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

Commits:

1 changed file:

Changes:

  • compiler/GHC/Tc/Solver/Equality.hs
    ... ... @@ -2291,6 +2291,7 @@ canEqCanLHSFinish_no_unification ev eq_rel swapped lhs rhs
    2291 2291
            ; check_result <- checkTypeEq ev eq_rel lhs rhs
    
    2292 2292
            ; case check_result of
    
    2293 2293
                 PuFail reason
    
    2294
    +{-
    
    2294 2295
                   | reason `cterHasOnlyProblems` do_not_prevent_rewriting
    
    2295 2296
                   ->   do { new_ev <- rewriteEqEvidenceSwapOnly ev eq_rel swapped lhs rhs
    
    2296 2297
                           ; continueWith $ Right $
    
    ... ... @@ -2298,6 +2299,7 @@ canEqCanLHSFinish_no_unification ev eq_rel swapped lhs rhs
    2298 2299
                                  , eq_lhs = lhs , eq_rhs = rhs } }
    
    2299 2300
     
    
    2300 2301
                   | otherwise
    
    2302
    +-}
    
    2301 2303
                   -> -- We can't unify, and this equality should not be used to rewrite
    
    2302 2304
                      -- other constraints (e.g. because it has an occurs check).
    
    2303 2305
                      -- So add it to the inert Irreds.
    
    ... ... @@ -2328,6 +2330,7 @@ canEqCanLHSFinish_no_unification ev eq_rel swapped lhs rhs
    2328 2330
                                , eq_lhs = lhs
    
    2329 2331
                                , eq_rhs = reductionReducedType rhs_redn } } }
    
    2330 2332
     
    
    2333
    +{-
    
    2331 2334
     -- | Some problems prevent /unification/ but not /rewriting/:
    
    2332 2335
     --
    
    2333 2336
     -- Skolem-escape: if we have [W] alpha[2] ~ Maybe b[3]
    
    ... ... @@ -2339,6 +2342,8 @@ canEqCanLHSFinish_no_unification ev eq_rel swapped lhs rhs
    2339 2342
     do_not_prevent_rewriting :: CheckTyEqResult
    
    2340 2343
     do_not_prevent_rewriting = cteProblem cteSkolemEscape S.<>
    
    2341 2344
                                cteProblem cteConcrete
    
    2345
    +-}
    
    2346
    +
    
    2342 2347
     ----------------------
    
    2343 2348
     finishCanWithIrred :: CtIrredReason -> CtEvidence
    
    2344 2349
                        -> TcS (StopOrContinue (Either IrredCt a))