Don't apply dataToTag's caseRules for data families
authorRyan Scott <ryan.gl.scott@gmail.com>
Sat, 3 Feb 2018 16:40:43 +0000 (11:40 -0500)
committerBen Gamari <ben@smart-cactus.org>
Sat, 3 Feb 2018 17:30:45 +0000 (12:30 -0500)
commitb7f9139ccddf4a1ca5839cd50ad8dba4f5e2e1dc
tree45a2899876acf07cdb720477dfde52cfb6bebd51
parent7a3a7ee938b05a297e4b624cae86e4f0caefb88a
Don't apply dataToTag's caseRules for data families

Commit 193664d42dbceadaa1e4689dfa17ff1cf5a405a0 added a
special caseRule for `dataToTag`, but this transformation completely
broke when `dataToTag` was applied to somewith with a type headed by
a data family, leading to #14680. For now at least, the simplest
solution is to simply not apply this transformation when the type is
headed by a data family.

Test Plan: make test TEST=T14680

Reviewers: simonpj, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14680

Differential Revision: https://phabricator.haskell.org/D4371

(cherry picked from commit d8a0e6d322deaa3743c95a11a6b7272577d1f86e)
compiler/prelude/PrelRules.hs
testsuite/tests/indexed-types/should_compile/T14680.hs [new file with mode: 0644]
testsuite/tests/indexed-types/should_compile/all.T