[GHC] #12082: Typeable on RealWorld fails

GHC ghc-devs at haskell.org
Thu Jun 2 22:04:02 UTC 2016


#12082: Typeable on RealWorld fails
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:
            Type:  bug               |               Status:  merge
        Priority:  high              |            Milestone:  8.0.2
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:  Typeable
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
                                     |  typecheck/should_run/TypeRep
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D2240,
       Wiki Page:                    |  Phab:D2239
-------------------------------------+-------------------------------------

Comment (by acfoltzer):

 We've somehow managed to run into this without using `typeRep` directly.
 Here is a shrink:

 {{{#!hs
 {-# LANGUAGE Rank2Types #-}

 import Data.Typeable (Typeable)
 import Control.Monad.ST (RealWorld)

 f :: forall a. (forall b. Typeable b => b -> a) -> a
 f = undefined :: (RealWorld -> a) -> a
 }}}

 {{{
 % ghci Crash.hs
 GHCi, version 8.0.1: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from ...
 [1 of 1] Compiling Main             ( Crash.hs, interpreted )
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.0.1 for x86_64-apple-darwin):
         tyConRep RealWorld

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

 >
 Leaving GHCi.
 }}}

 We were able to get around it for our project (it turned out we didn't
 need to use `RealWorld` at all) but hopefully this test case helps
 validate the patch for this issue.

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


More information about the ghc-tickets mailing list