Skip to content
  • Simon Peyton Jones's avatar
    Flattener preserves synonyms, rewriteEvidence can drop buggy "optimisation" · 6ae678e3
    Simon Peyton Jones authored
    There was a special case in rewriteEvidence, looking like:
      = return (Just (if ctEvPred old_ev `tcEqType` new_pred
                      then old_ev
                      else old_ev { ctev_pred = new_pred }))
    
    But this was wrong: old_pred and new_pred might differ in the kind
    of a TyVar occurrence, in which case tcEqType would not notice,
    but we really, really want new_pred.  This caused Trac #8913.
    
    I solved this by dropping the whole test, and instead making
    the flattener preserve type synonyms. This was easy because
    TcEvidence has TcTyConAppCo which (unlike) Coercion, handles
    synonyms.
    6ae678e3