[GHC] #12081: TypeInType Compile-time Panic

GHC ghc-devs at haskell.org
Wed Jul 13 15:04:36 UTC 2016


#12081: TypeInType Compile-time Panic
-------------------------------------+-------------------------------------
        Reporter:  MichaelK          |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1-rc4
      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 MitchellSalad):

 I happened to hit this same panic with a simpler example:

 {{{#!hs
 {-# LANGUAGE DataKinds #-}
 {-# LANGUAGE ExistentialQuantification #-}
 {-# LANGUAGE KindSignatures #-}
 {-# LANGUAGE TypeInType #-}

 data Foo = forall (x :: Foo). Bar x
 }}}

 fails with:

 {{{
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.0.1 for x86_64-unknown-linux):
         isInjectiveTyCon sees a TcTyCon Foo
 }}}

 Without -XTypeInType, it fails with:

 {{{
 foo.hs:5:25: error:
     • Type constructor ‘Foo’ cannot be used here
         (Perhaps you intended to use TypeInType)
     • In the kind ‘Foo’
       In the definition of data constructor ‘Bar’
       In the data declaration for ‘Foo’
 }}}

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


More information about the ghc-tickets mailing list