• Edward Z. Yang's avatar
    Fix handling of closed type families in Backpack. · f59aad68
    Edward Z. Yang authored
    Summary:
    A few related problems:
    
    - CoAxioms, like DFuns, are implicit and never exported,
      so we have to make sure we treat them the same way as
      DFuns: in RnModIface we need to rename references to
      them with rnIfaceImplicit and in mergeSignatures we need
      to NOT check them directly for compatibility (the
      test on the type family will do this check for us.)
    
    - But actually, we weren't checking if the axioms WERE
      consistent.  This is because we were forwarding all
      embedded CoAxiom references in the type family TyThing
      to the merged version, but that reference was what
      checkBootDeclM was using as a comparison point.
      This is similar to a problem we saw with DFuns.
    
      To fix this, I refactored the handling of implicit entities in TcIface
      for Backpack.  See Note [The implicit TypeEnv] for the gory details.
      Instead of passing the TypeEnv around explicitly, we stuffed it in
      IfLclEnv.
    Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
    
    Test Plan: validate
    
    Reviewers: bgamari, simonpj, austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2928
    f59aad68
bkp49.stderr 164 Bytes