qAddTopDecls: can't convert top-level declarations
The following program crashes 8.2.2 and HEAD (8.5.20171228).
{-# LANGUAGE TemplateHaskell #-}
import Language.Haskell.TH.Syntax (addTopDecls)
$(do
ds <- [d| f = Bool
|]
addTopDecls ds
[d| g = cab
|])
Output:
Exception when trying to run compile-time code:
ghc: panic! (the 'impossible' happened)
(GHC version 8.5.20171228 for x86_64-unknown-linux):
qAddTopDecls: can't convert top-level declarations
Illegal variable name: ‘Bool’
When splicing a TH declaration: f_0 = Bool
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in ghc:Outputable
pprPanic, called at compiler/typecheck/TcSplice.hs:886:27 in ghc:TcSplice
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Trac metadata
Trac field | Value |
---|---|
Version | 8.2.2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | Linux |
Architecture | x86_64 (amd64) |