Fix binder visiblity for default methods
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
Showing
- compiler/basicTypes/Var.hs 10 additions, 1 deletioncompiler/basicTypes/Var.hs
- compiler/iface/BuildTyCl.hs 3 additions, 67 deletionscompiler/iface/BuildTyCl.hs
- compiler/iface/TcIface.hs 1 addition, 1 deletioncompiler/iface/TcIface.hs
- compiler/typecheck/TcPatSyn.hs 1 addition, 2 deletionscompiler/typecheck/TcPatSyn.hs
- compiler/typecheck/TcTyClsDecls.hs 1 addition, 1 deletioncompiler/typecheck/TcTyClsDecls.hs
- compiler/typecheck/TcTyDecls.hs 11 additions, 3 deletionscompiler/typecheck/TcTyDecls.hs
- compiler/typecheck/TcType.hs 1 addition, 1 deletioncompiler/typecheck/TcType.hs
- compiler/types/Class.hs 4 additions, 0 deletionscompiler/types/Class.hs
- compiler/types/TyCoRep.hs 32 additions, 22 deletionscompiler/types/TyCoRep.hs
- compiler/types/TyCon.hs 69 additions, 3 deletionscompiler/types/TyCon.hs
- compiler/types/Type.hs 0 additions, 8 deletionscompiler/types/Type.hs
- testsuite/tests/deriving/should_compile/T13998.hs 43 additions, 0 deletionstestsuite/tests/deriving/should_compile/T13998.hs
- testsuite/tests/deriving/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/deriving/should_compile/all.T
Loading
Please register or sign in to comment