Skip to content
  • Simon Peyton Jones's avatar
    Fix binder visiblity for default methods · 75bf11c0
    Simon Peyton Jones authored
    Trac #13998 showed that default methods were getting bogus tyvar
    binder visiblity info; and that it matters in the code genreated
    by the default-method fill-in mechanism
    
    * The actual fix: in TcTyDecls.mkDefaultMethodType, make TyVarBinders
      with the right visibility info by getting TyConBinders from the
      class TyCon.  (Previously we made up visiblity info, but that
      caused #13998.)
    
    * Define TyCon.tyConTyVarBinders :: [TyConBinder] -> [TyVarBinder]
      which can build correct forall binders for
        a) default methods (Trac #13998)
        b) data constructors
      This was originally BuildTyCl.mkDataConUnivTyVarBinders
    
    * Move mkTyVarBinder, mkTyVarBinders from Type to Var
    75bf11c0