Handle `type data` properly in tyThingParent_maybe
Unlike most other data constructors, data constructors declared with type data
are represented in TyThing
s 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).