Skip to content

Handle `type data` properly in tyThingParent_maybe

Ryan Scott requested to merge wip/T22817 into master

Unlike most other data constructors, data constructors declared with type data are represented in TyThings as ATyCon rather than ADataCon. The ATyCon case in tyThingParent_maybe previously did not consider the possibility of the underlying TyCon being a promoted data constructor, which led to the oddities observed in #22817 (closed). This patch adds a dedicated special case in tyThingParent_maybe's ATyCon case for type data data constructors to fix these oddities.

Fixes #22817 (closed).

Merge request reports