Skip to content
  • Simon Peyton Jones's avatar
    Fix solveOneFromTheOther for RecursiveSuperclasses · 65069806
    Simon Peyton Jones authored
    This patch fixes the redundant superclass expansion
    in Trac #14774.
    
    The main change is to fix TcInterac.solveOneFromTheOther, so
    that it does not prefer a work-item with a binding if that binding
    transitively depends on the inert item we are comparing it with.
    
    Explained in Note [Replacement vs keeping] in TcInert, esp
    item (c) of the "Constraints coming from the same level" part.
    
    To make this work I refactored out a new function
    TcEvidence.findNeededEvVars, which was previously buried
    inside TcSimplify.neededEvVars.
    
    I added quite a few more comments and signposts about superclass
    expansion.
    65069806