Skip to content
  • Ryan Scott's avatar
    Don't permit data types with return kind Constraint · b5c50241
    Ryan Scott authored
    Previously, GHC allowed all of the following:
    
    ```lang=haskell
    data Foo1 :: Constraint
    data family Foo2 :: Constraint
    data family Foo3 :: k
    data instance Foo3 :: Constraint
    ```
    
    Yikes! This is because GHC was confusing `Type` with `Constraint`
    due to careless use of the `isLiftedTypeKind` function. To respect
    this distinction, I swapped `isLiftedTypeKind` out for
    `tcIsStarKind`—which does respect this distinction—in the right
    places.
    
    Test Plan: make test TEST="T14048a T14048b T14048c"
    
    Reviewers: bgamari
    
    Reviewed By: bgamari
    
    Subscribers: goldfire, rwbarton, thomie, carter
    
    GHC Trac Issues: #14048
    
    Differential Revision: https://phabricator.haskell.org/D4479
    
    (cherry picked from commit f748c529)
    b5c50241