[GHC] #9693: Reloading GHCi with Template Haskell names can panic GHC

GHC ghc-devs at haskell.org
Wed Oct 15 11:36:03 UTC 2014


#9693: Reloading GHCi with Template Haskell names can panic GHC
-------------------------------------+-------------------------------------
       Reporter:  maxs               |                   Owner:
           Type:  bug                |                  Status:  new
       Priority:  normal             |               Milestone:
      Component:  Compiler           |                 Version:  7.8.3
       Keywords:                     |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Unknown            |         Type of failure:  GHC
     Blocked By:                     |  rejects valid program
Related Tickets:                     |               Test Case:
                                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 First, load the following program into GHCi.

 '''Fun.hs'''
 {{{#!hs
 module Fun where
 import Language.Haskell.TH

 stuff = do
   -- let x = mkName "X"
   x <- newName "X"
   sequence $ [dataD (return []) x [] [
       normalC x []
     ] []]
 }}}

 '''thbug.hs'''
 {{{#!hs
 {-# LANGUAGE TemplateHaskell #-}
 import Fun

 stuff
 }}}

 Then comment out the newName, un comment the mkName and reload GHCi.

 {{{
 ghc: panic! (the 'impossible' happened)
   (GHC version 7.8.3 for x86_64-apple-darwin):
         kcLookupKind APromotionErr RecDataConPE

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

 It is important to note this is a valid program, if you then close GHCi
 and start it again with the modified file, it will load correctly.
 Reloading after attempting to compile the newName version will cause a
 panic.

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


More information about the ghc-tickets mailing list