Fix newtype instance GADTs
authorRyan Scott <ryan.gl.scott@gmail.com>
Thu, 5 Jul 2018 12:49:50 +0000 (08:49 -0400)
committerRyan Scott <ryan.gl.scott@gmail.com>
Thu, 5 Jul 2018 13:47:58 +0000 (09:47 -0400)
commit927518668111584a06f12bd9eb1b0910a38acf4f
treecb99d43b23b489f684bfa8dbd1b0d1422961f0f8
parent132273f34e394bf7e900d0c15e01e91edd711890
Fix newtype instance GADTs

Summary: This was taken from Richard's branch, which in turn was
submitted to Phab by Matthew, which in turn was commandeered by Ryan.

This fixes an issue with newtype instances in which too many
coercions were being applied in the worker. This fixes the issue by
removing the data family instance axiom from the worker and moving
to the wrapper. Moreover, we now require all newtype instances
to have wrappers, for symmetry with data instances.

Reviewers: goldfire, bgamari, simonpj, mpickering

Reviewed By: mpickering

Subscribers: simonpj, rwbarton, thomie, carter

GHC Trac Issues: #15318

Differential Revision: https://phabricator.haskell.org/D4902
compiler/basicTypes/MkId.hs
testsuite/tests/indexed-types/should_compile/T15318.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_compile/all.T