Equip abstract classes with abstract TyCons
ClosedPublic

Authored by ezyang on Feb 28 2017, 1:52 AM.

Details

Summary

Previously, we did a very skeevy check on the methods, ATs
and theta to see if something was abstract or not. Now,
this stuff is all put in buildClass where it belongs, and
we look to see if the TyCon is abstract or not to tell if we have
abstract class. This also fixes a bug where abstract type classes
were incorrectly treated as representationally injective
(they're not!)

TODO: We should probably modify IfaceClass to directly store
some bit indicating that they are abstract, rather than plumb is_boot
around.

Fixes Trac #13347, and a TODO in the code.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>

Test Plan

validate

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ezyang created this revision.Feb 28 2017, 1:52 AM
ezyang updated this revision to Diff 11428.Feb 28 2017, 6:10 PM

updates!

ezyang updated this revision to Diff 11469.Mar 1 2017, 1:04 PM

stop outputting where clause

bgamari requested changes to this revision.Mar 1 2017, 2:07 PM

This looks reasonable to me but a few comments inline.

compiler/iface/BuildTyCl.hs
304

This should really mention when we will see Nothing.

388

Indeed this is a tad clearer.

compiler/iface/IfaceSyn.hs
171

It would be helpful if this mentioned that abstract classes occur only in signatures. In general I think it's helpful to leave breadcrumbs making it clear where pieces of implementation are backpack specific.

1601–1612

I probably wouldn't have bothered to avoid the interface change and it does make the implementation a bit harder to check, but this works for now.

This revision now requires changes to proceed.Mar 1 2017, 2:07 PM
ezyang updated this revision to Diff 11471.Mar 1 2017, 4:37 PM
ezyang edited edge metadata.

comments from bgamari

bgamari accepted this revision.Mar 2 2017, 2:07 PM

Looks fine to me.

This revision is now accepted and ready to land.Mar 2 2017, 2:07 PM
bgamari requested changes to this revision.Mar 2 2017, 3:29 PM

This also needs to be rebased.

This revision now requires changes to proceed.Mar 2 2017, 3:29 PM
This revision was automatically updated to reflect the committed changes.