Don't permit data types with return kind Constraint
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)
Showing
- compiler/typecheck/TcInstDcls.hs 3 additions, 2 deletionscompiler/typecheck/TcInstDcls.hs
- compiler/typecheck/TcTyClsDecls.hs 2 additions, 2 deletionscompiler/typecheck/TcTyClsDecls.hs
- testsuite/tests/typecheck/should_fail/T14048a.hs 6 additions, 0 deletionstestsuite/tests/typecheck/should_fail/T14048a.hs
- testsuite/tests/typecheck/should_fail/T14048a.stderr 5 additions, 0 deletionstestsuite/tests/typecheck/should_fail/T14048a.stderr
- testsuite/tests/typecheck/should_fail/T14048b.hs 7 additions, 0 deletionstestsuite/tests/typecheck/should_fail/T14048b.hs
- testsuite/tests/typecheck/should_fail/T14048b.stderr 6 additions, 0 deletionstestsuite/tests/typecheck/should_fail/T14048b.stderr
- testsuite/tests/typecheck/should_fail/T14048c.hs 9 additions, 0 deletionstestsuite/tests/typecheck/should_fail/T14048c.hs
- testsuite/tests/typecheck/should_fail/T14048c.stderr 5 additions, 0 deletionstestsuite/tests/typecheck/should_fail/T14048c.stderr
- testsuite/tests/typecheck/should_fail/all.T 3 additions, 0 deletionstestsuite/tests/typecheck/should_fail/all.T
Loading
Please register or sign in to comment