#5362: ghc: panic! mkUsageInfo: internal name? constr_a2Py{v}
----------------------------------+-----------------------------------------
    Reporter:  markwright         |        Owner:                               
                    
        Type:  bug                |       Status:  new                          
                    
    Priority:  highest            |    Milestone:  7.2.1                        
                    
   Component:  Template Haskell   |      Version:  7.1                          
                    
    Keywords:  panic mkUsageInfo  |     Testcase:  
http://hackage.haskell.org/package/syb-with-class
   Blockedby:                     |   Difficulty:                               
                    
          Os:  Linux              |     Blocking:                               
                    
Architecture:  x86_64 (amd64)     |      Failure:  Compile-time crash           
                    
----------------------------------+-----------------------------------------

Comment(by igloo):

 Ah, sorry! I hadn't noticed, but my final change had worked around the
 bug. You need to have an export list:
 {{{
 {-# LANGUAGE TemplateHaskell #-}

 module Foo () where

 import Language.Haskell.TH

 $(
     do fName <- newName "f"
        gName <- newName "g"
        let gExp = varE gName

        sdf <- sigD fName [t| () |]
        sdg <- sigD gName [t| () |]
        fdf <- funD fName [clause [] (normalB [| undefined $gExp |]) []]
        fdg <- funD gName [clause [] (normalB [| undefined       |]) []]
        let ds = [sdf, fdf, sdg, fdg]
        runIO $ putStrLn $ pprint ds
        return ds
     )
 }}}

 {{{
 $ ghc --make q.hs
 [1 of 1] Compiling Foo              ( q.hs, q.o )
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 Loading package ffi-1.0 ... linking ... done.
 Loading package pretty-1.1.0.0 ... linking ... done.
 Loading package array-0.3.0.3 ... linking ... done.
 Loading package containers-0.4.1.0 ... linking ... done.
 Loading package template-haskell ... linking ... done.
 f_0 :: GHC.Unit.()
 f_0 = GHC.Err.undefined g_1
 g_1 :: GHC.Unit.()
 g_1 = GHC.Err.undefined
 ghc-stage2: panic! (the 'impossible' happened)
   (GHC version 7.2.0.20110728 for x86_64-unknown-linux):
         mkUsageInfo: internal name? g_aXE{v}

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

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5362#comment:5>
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