Skip to content

Consistently use validity checks for TH conversion of data constructors

Ryan Scott requested to merge wip/T22559 into master

We were checking that TH-spliced data declarations do not look like this:

data D :: Type = MkD Int

But we were only doing so for data declarations' data constructors, not for newtypes, data instances, or newtype instances. This patch factors out the necessary validity checks into its own cvtDataDefnCons function and uses it in all of the places where it needs to be.

Fixes #22559 (closed).

Merge request reports