#4863: ghc panic when reifying the result of classInstances
-------------------------------+--------------------------------------------
    Reporter:  guest           |       Owner:                    
        Type:  bug             |      Status:  new               
    Priority:  normal          |   Component:  Template Haskell  
     Version:  7.0.1           |    Keywords:                    
    Testcase:                  |   Blockedby:                    
          Os:  Linux           |    Blocking:                    
Architecture:  x86_64 (amd64)  |     Failure:  Compile-time crash
-------------------------------+--------------------------------------------
 {{{
 Prelude Language.Haskell.TH Language.Haskell.TH.Syntax> $(fmap show
 (classInstances ''Eq [ConT ''Int] >>= reify . head) >>= lift)

 <interactive>:1:3:
     Exception when trying to run compile-time code:
       <interactive>: panic! (the 'impossible' happened)
   (GHC version 7.0.1 for x86_64-unknown-linux):
         reifyType PredTy
     <pred>base:GHC.Classes.Eq{tc 23} ghc-prim:GHC.Types.Int{(w) tc 3J}

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

       Code: (>>=)
               fmap
                 (show)
                 ((>>=)
                    classInstances 'Eq [Language.Haskell.TH.Syntax.ConT
 'Int]
                    (.) reify head)
               lift
     In the expression:
       $(fmap show (classInstances 'Eq [ConT 'Int] >>= reify . head)
       >>=
         lift)
     In an equation for `it':
         it
           = $(fmap show (classInstances 'Eq [ConT 'Int] >>= reify . head)
             >>=
               lift)
 }}}
 The same thing happens when compiling with ghc rather than using GHCi.
 Also, it looks like the pretty printer is displaying {{{ ''Eq }}} and {{{
 ''Int }}} incorrectly.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to