• simonpj@microsoft.com's avatar
    Fix pre-subsumption and pre-matching · 3098d214
    simonpj@microsoft.com authored
    The pre-subsuption and pre-matching functions should NEVER make bogus
    bindings of type variables, although they are free to bale out and make
    too few bindings.
    
    I hadn't been thiking carefully enough about this, and there were two
    separate bugs.  
    
    - Firstly, in pre-subsumption we must ignore the 'theta'
      part of any overloaded type.  
    
    - Second, in pre-matching, we must return the empty subustition 
      on a mis-match, rather than returning the substitution so far.
    
    This bug showed up when compiling Data.Generics.Schemes.hs, and is
    imortalised in test tc206
    3098d214
TcUnify.lhs 66.1 KB