
#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 | Version: 8.0.1-rc2 (Type checker) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- 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@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 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler