[GHC] #11964: Without TypeInType, inconsistently accepts Data.Kind.Type but not type synonym

GHC ghc-devs at haskell.org
Wed Apr 20 23:32:12 UTC 2016


#11964: Without TypeInType, inconsistently accepts Data.Kind.Type but not type
synonym
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                Owner:  goldfire
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1-rc2
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by ezyang:

@@ -4,1 +4,1 @@
- ```
+ {{{
@@ -9,1 +9,1 @@
- ```
+ }}}
@@ -14,1 +14,1 @@
- ```
+ {{{
@@ -28,1 +28,1 @@
- ```
+ }}}

New description:

 For convenience, I'll use GHCi to demonstrate flag behavior. First, we
 define a file:

 {{{
 {-# LANGUAGE TypeInType #-}
 import Data.Kind
 type Star = Type
 newtype T k (t :: k) = T ()
 }}}

 Next, we load it up in GHCi, WITHOUT `-XTypeInType`. Now we observe
 strange behavior:

 {{{
 ezyang at sabre:~$ ghc-8.0 --interactive C.hs
 GHCi, version 8.0.0.20160204: http://www.haskell.org/ghc/  :? for help
 [1 of 1] Compiling Main             ( C.hs, interpreted )
 Ok, modules loaded: Main.
 *Main> :k T Type Int
 T Type Int :: *
 *Main> :k T Star Int

 <interactive>:1:3: error:
     • Data constructor ‘Star’ cannot be used here
         (Perhaps you intended to use DataKinds)
     • In the first argument of ‘T’, namely ‘Star’
       In the type ‘T Star Int’
 }}}

 Of course, if we pass `-TypeInType` to GHCi that fixes the problem (BTW,
 `DataKinds` does NOT solve the problem.)

--

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11964#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list