summaryrefslogtreecommitdiff
path: root/compiler/iface/ToIface.hs
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2017-10-29 20:48:19 -0400
committerBen Gamari <ben@smart-cactus.org>2017-10-29 21:51:05 -0400
commit85aa1f4253163985fe07d172f8da73b784bb7b4b (patch)
treead42e09d5d24a4d8e199ab35b34f29ef4190a3d4 /compiler/iface/ToIface.hs
parent7673561555ae354fd9eed8de1e57c681906e2d49 (diff)
downloadhaskell-85aa1f4253163985fe07d172f8da73b784bb7b4b.tar.gz
Fix #14390 by making toIfaceTyCon aware of equality
GHC was panicking when pretty-printing a heterogeneous equality type constructor (#14390) because the function which produced the type constructor, `toIfaceTyCon`, wasn't attaching the appropriate `IfaceTyConSort` for equality type constructors, which is `IfaceEqualityTyCon`. This is fixed easily enough. Test Plan: make test TEST=T14390 Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #14390 Differential Revision: https://phabricator.haskell.org/D4132
Diffstat (limited to 'compiler/iface/ToIface.hs')
-rw-r--r--compiler/iface/ToIface.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/iface/ToIface.hs b/compiler/iface/ToIface.hs
index 9eceb6d750..6f71af516e 100644
--- a/compiler/iface/ToIface.hs
+++ b/compiler/iface/ToIface.hs
@@ -195,6 +195,12 @@ toIfaceTyCon tc
| isUnboxedSumTyCon tc
, Just cons <- isDataSumTyCon_maybe tc = IfaceSumTyCon (length cons)
+ | tyConName tc == eqTyConName || tc == eqPrimTyCon
+ = IfaceEqualityTyCon True
+
+ | tc `elem` [heqTyCon, eqReprPrimTyCon]
+ = IfaceEqualityTyCon False
+
| otherwise = IfaceNormalTyCon