There were two bugs here:
-
Treating type-level constructors as PromotedDataCon doesn't always work, in particular because constructors promoted via DataKinds are called both T and 'T. (Tests T22332a, T22332b, T22315) Fix: guard these cases with isDataKindsPromotedDataCon.
-
Type-level constructors were sent to the code generator, producing things like constructor wrappers. (Tests T22332a, T22332b) Fix: test for them in isDataTyCon.
Also added a test TDGADT for a type-level GADT.