diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2018-03-19 12:06:41 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-03-19 12:06:45 -0400 |
commit | f748c52997f61a9f58eccbf4b8df0a0c8c6887e5 (patch) | |
tree | a6620f06cdbcf605d963a102e95c30959becb8fd /testsuite/tests/typecheck/should_fail/T14048b.stderr | |
parent | c3aea39678398fdf88166f30f0d01225a1874a32 (diff) | |
download | haskell-f748c52997f61a9f58eccbf4b8df0a0c8c6887e5.tar.gz |
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
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/T14048b.stderr')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T14048b.stderr | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T14048b.stderr b/testsuite/tests/typecheck/should_fail/T14048b.stderr new file mode 100644 index 0000000000..fe78d9f7f5 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T14048b.stderr @@ -0,0 +1,6 @@ + +T14048b.hs:7:1: error: + • Kind signature on data type declaration has non-* + and non-variable return kind + Constraint + • In the data family declaration for ‘Foo’ |