[GHC] #11554: Self quantification in GADT data declarations
GHC
ghc-devs at haskell.org
Fri May 27 19:41:01 UTC 2016
#11554: Self quantification in GADT data declarations
-------------------------------------+-------------------------------------
Reporter: Rafbill | Owner:
Type: bug | Status: new
Priority: high | Milestone: 8.0.2
Component: Compiler (Type | Version: 8.0.1-rc2
checker) |
Resolution: | Keywords: TypeInType
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by alexvieth):
I have a patch which will reject the example in comment:7 and give this
error
{{{
• Type constructor ‘A’ cannot be used here
(it is defined and used in the same recursive group)
• In the kind ‘A’
In the definition of data constructor ‘B’
In the data declaration for ‘A’
}}}
The details:
- `ATcTyThing` has a new variant `ATcTyConUnpromoted TyCon` meaning the
`TyCon` can't be used as a kind.
- `tcTyVar` will give a promotion error (`TyConPE`) whenever an
`ATcTyConUnpromoted` is encountered and the `TcTyMode` is kind level.
- When checking the constructors of a `DataDecl`, the name of the type is
associated with an `ATcTyConUnpromoted`, rather than `ATcTyCon` as it is
now.
Think this is a sane thing to do? If so I'll upload it to phab.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11554#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list