• Edward Z. Yang's avatar
    Properly represent abstract classes in Class and IfaceDecl · fb5cd9d6
    Edward Z. Yang authored
    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: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
    Test Plan: validate
    Reviewers: simonpj, bgamari, austin
    Subscribers: goldfire, thomie
    Differential Revision: https://phabricator.haskell.org/D3236
Class.hs 12.4 KB