[commit: ghc] master: Properly represent abstract classes in Class and IfaceDecl (fb5cd9d)

git at git.haskell.org git at git.haskell.org
Thu Mar 2 23:59:31 UTC 2017


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

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

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

commit fb5cd9d6d6185afe6d4ef2f3df3f895b6d0abf4c
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Mon Feb 27 23:48:30 2017 -0800

    Properly represent abstract classes in Class and IfaceDecl
    
    Summary:
    Previously, abstract classes looked very much like normal
    classes, except that they happened to have no methods,
    superclasses or ATs, and they came from boot files.  This
    patch gives abstract classes a proper representation in
    Class and IfaceDecl, by moving the things which are never
    defined for abstract classes into ClassBody/IfaceClassBody.
    
    Because Class is abstract, this change had ~no disruption
    to any of the code in GHC; if you ask about the methods of
    an abstract class, we'll just give you an empty list.
    
    This also fixes a bug where abstract type classes were incorrectly
    treated as representationally injective (they're not!)
    
    Fixes #13347, and a TODO in the code.
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
    
    Test Plan: validate
    
    Reviewers: simonpj, bgamari, austin
    
    Subscribers: goldfire, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3236


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

fb5cd9d6d6185afe6d4ef2f3df3f895b6d0abf4c
 compiler/backpack/RnModIface.hs                    |  18 +--
 compiler/iface/BuildTyCl.hs                        |  39 +++++--
 compiler/iface/IfaceSyn.hs                         | 129 ++++++++++++++++-----
 compiler/iface/MkIface.hs                          |  20 ++--
 compiler/iface/TcIface.hs                          |  50 +++++---
 compiler/typecheck/TcRnDriver.hs                   |  23 +---
 compiler/typecheck/TcTyClsDecls.hs                 |  13 ++-
 compiler/types/Class.hs                            | 116 +++++++++++++-----
 compiler/vectorise/Vectorise/Type/TyConDecl.hs     |   9 +-
 testsuite/tests/typecheck/should_compile/Makefile  |   6 +
 testsuite/tests/typecheck/should_compile/Tc271.hs  |  10 ++
 .../tests/typecheck/should_compile/Tc271.hs-boot   |   5 +
 testsuite/tests/typecheck/should_compile/Tc271a.hs |   5 +
 testsuite/tests/typecheck/should_compile/all.T     |   1 +
 14 files changed, 315 insertions(+), 129 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 fb5cd9d6d6185afe6d4ef2f3df3f895b6d0abf4c


More information about the ghc-commits mailing list