#2739: GHC API crashes on template haskell splices
---------------------------------+------------------------------------------
    Reporter:  waern             |       Owner:                  
        Type:  bug               |      Status:  new             
    Priority:  normal            |   Component:  Compiler        
     Version:  6.10.1            |    Severity:  major           
    Keywords:                    |    Testcase:                  
Architecture:  Unknown/Multiple  |          Os:  Unknown/Multiple
---------------------------------+------------------------------------------
 The GHC API crashes when type checking these two modules:

 {{{TH.hs}}}:

 {{{
 {-# LANGUAGE TemplateHaskell #-}

 module TH where

 import Language.Haskell.TH

 decl = [d| f x = x]
 }}}

 {{{TH2.hs}}}:

 {{{
 {-# LANGUAGE TemplateHaskell #-}

 module TH2 where

 import TH

 $( decl )
 }}}


 The crash happens in {{{HscMain.compileExpr}}}, when compiling and linking
 the spliced-in
 code. The crash is due to a {{{fromJust: Nothing}}}. I don't have the
 error message at hand.

 It would be nice if this could be fixed in 6.10.* since it makes Haddock
 crash when processing several packages on Hackage.

 I will add both {{{TH.hs}}} and {{{TH2.hs}}} to the test suite in the
 {{{code.haskell.org/haddock}}} repository later. (I thought I had done
 this, but I apparently forgot to add TH.hs). You can the use
 {{{test/runtests.hs}}} to invoke the crash.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2739>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to