[GHC] #14048: Data instances of kind Constraint
GHC
ghc-devs at haskell.org
Mon Mar 19 16:41:21 UTC 2018
#14048: Data instances of kind Constraint
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #12369 | Differential Rev(s): Phab:D4479
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari <ben@…>):
In [changeset:"f748c52997f61a9f58eccbf4b8df0a0c8c6887e5/ghc"
f748c529/ghc]:
{{{
#!CommitTicketReference repository="ghc"
revision="f748c52997f61a9f58eccbf4b8df0a0c8c6887e5"
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
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14048#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list