Ticket #2739 (closed bug: fixed)
GHC API crashes on template haskell splices
| Reported by: | waern | Owned by: | nominolo |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.10.2 |
| Component: | Compiler | Version: | 6.10.1 |
| Keywords: | Cc: | david.waern@…, leather@…, sanzhiyan@… | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
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.
Change History
Note: See
TracTickets for help on using
tickets.
