Ticket #4863 (new bug)
TH crashes if you reify the Name of a dfun
| Reported by: | guest | Owned by: | simonpj |
|---|---|---|---|
| Priority: | low | Milestone: | _|_ |
| Component: | Template Haskell | Version: | 7.0.1 |
| Keywords: | Cc: | ||
| Operating System: | Linux | Architecture: | x86_64 (amd64) |
| Type of failure: | Compile-time crash | Difficulty: | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
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.
Change History
Note: See
TracTickets for help on using
tickets.
