[commit: ghc] master: Fix binder visiblity for default methods (75bf11c)

git at git.haskell.org git at git.haskell.org
Wed Jul 26 11:34:12 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/75bf11c037d9e82f95ac9779bfd2b1432835bd76/ghc

>---------------------------------------------------------------

commit 75bf11c037d9e82f95ac9779bfd2b1432835bd76
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Jul 26 08:51:47 2017 +0100

    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


>---------------------------------------------------------------

75bf11c037d9e82f95ac9779bfd2b1432835bd76
 compiler/basicTypes/Var.hs                        | 11 +++-
 compiler/iface/BuildTyCl.hs                       | 70 +---------------------
 compiler/iface/TcIface.hs                         |  2 +-
 compiler/typecheck/TcPatSyn.hs                    |  3 +-
 compiler/typecheck/TcTyClsDecls.hs                |  2 +-
 compiler/typecheck/TcTyDecls.hs                   | 14 ++++-
 compiler/typecheck/TcType.hs                      |  2 +-
 compiler/types/Class.hs                           |  4 ++
 compiler/types/TyCoRep.hs                         | 54 ++++++++++-------
 compiler/types/TyCon.hs                           | 72 ++++++++++++++++++++++-
 compiler/types/Type.hs                            |  8 ---
 testsuite/tests/deriving/should_compile/T13998.hs | 43 ++++++++++++++
 testsuite/tests/deriving/should_compile/all.T     |  1 +
 13 files changed, 177 insertions(+), 109 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 75bf11c037d9e82f95ac9779bfd2b1432835bd76


More information about the ghc-commits mailing list