Skip to content
  • Ryan Scott's avatar
    Consistently use validity checks for TH conversion of data constructors · 3ab0155b
    Ryan Scott authored and Marge Bot's avatar Marge Bot committed
    We were checking that TH-spliced data declarations do not look like this:
    
    ```hs
    data D :: Type = MkD Int
    ```
    
    But we were only doing so for `data` declarations' data constructors, not for
    `newtype`s, `data instance`s, or `newtype instance`s. 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.
    3ab0155b