Skip to content

Introduce isBoxedTupleDataCon and use it to fix #18644

Ryan Scott requested to merge wip/T18644 into master

The code that converts promoted tuple data constructors to IfaceTypes in GHC.CoreToIface was using isTupleDataCon, which conflates boxed and unboxed tuple data constructors. To avoid this, this patch introduces isBoxedTupleDataCon, which is like isTupleDataCon but only works for boxed tuple data constructors.

While I was in town, I was horribly confused by the fact that there were separate functions named isUnboxedTupleCon and isUnboxedTupleTyCon (similarly, isUnboxedSumCon and isUnboxedSumTyCon). It turns out that the former only works for data constructors, despite its very general name! I opted to rename isUnboxedTupleCon to isUnboxedTupleDataCon (similarly, I renamed isUnboxedSumCon to isUnboxedSumDataCon) to avoid this potential confusion, as well as to be more consistent with the naming convention I used for isBoxedTupleDataCon.

Fixes #18644 (closed).

Merge request reports