[GHC] #11334: GHC panic when calling typeOf on a promoted data constructor

GHC ghc-devs at haskell.org
Fri Jan 1 20:19:24 UTC 2016


#11334: GHC panic when calling typeOf on a promoted data constructor
-------------------------------------+-------------------------------------
           Reporter:  RyanGlScott    |             Owner:
               Type:  bug            |            Status:  new
           Priority:  high           |         Milestone:
          Component:  Compiler       |           Version:  8.1
  (Type checker)                     |
           Keywords:                 |  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:
-------------------------------------+-------------------------------------
 Here's what I did in GHCi to trigger the panic:

 {{{
 $ inplace/bin/ghc-stage2 --interactive
 GHCi, version 8.1.20160101: http://www.haskell.org/ghc/  :? for help
 λ> :set -XDataKinds
 λ> :m Data.Typeable Data.Functor.Compose
 λ> typeOf (Proxy :: Proxy 'Compose)
 ghc-stage2: panic! (the 'impossible' happened)
   (GHC version 8.1.20160101 for x86_64-unknown-linux):
         piResultTy
   *
   TYPE 'Lifted *

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
 }}}

 Enabling `-XPolyKinds` doesn't trigger the error, though; #10343 will be
 triggered instead:

 {{{
 λ> :set -XPolyKinds
 λ> typeOf (Proxy :: Proxy 'Compose)

 <interactive>:5:1: error:
     • No instance for (Typeable a0) arising from a use of ‘typeOf’
     • In the expression: typeOf (Proxy :: Proxy Compose)
       In an equation for ‘it’: it = typeOf (Proxy :: Proxy Compose)
 }}}

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


More information about the ghc-tickets mailing list