Skip to content
  • Simon Peyton Jones's avatar
    Fix two more bugs in partial signatures · 3d2664e4
    Simon Peyton Jones authored
    These were shown up by Trac #14643
    
    Bug 1: if we had a single partial signature for
    two functions
       f, g :: forall a. _ -> a
    then we made two different SigTvs but with the sane Name.
    This was jolly confusing and ultimately led to deeply bogus
    results with Any's appearing in the resulting program. Yikes.
    Fix: clone the quantified variables in TcSigs.tcInstSig (as
    indeed its name suggests).
    
    Bug 2: we were not eliminating duplicate/superclass constraints
    in the partial signatures of a mutually recursive group.
    
    Easy to fix: we are already doing dup/superclass elim in
    TcSimplify.decideQuantification.  So we move the partial-sig
    constraints there too.
    
    (cherry picked from commit 1577908f)
    3d2664e4