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 16:46:21 +0000 (11:46 -0500)
commitd8a0e6d322deaa3743c95a11a6b7272577d1f86e
tree90d2b540e06f4d53fe27b298f76c677d64ca8278
parent217e4170bdce3df28a667803ce5e619553bfecdd
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
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