qAddTopDecls: can't convert top-level declarations
The following program crashes 8.2.2 and HEAD (8.5.20171228).
```hs
{-# 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
```
<details><summary>Trac metadata</summary>
| 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) |
</details>
<!-- {"blocked_by":[],"summary":"qAddTopDecls: can't convert top-level declarations","status":"New","operating_system":"Linux","component":"Compiler","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.2.2","keywords":[],"differentials":[],"test_case":"","architecture":"x86_64 (amd64)","cc":[""],"type":"Bug","description":"The following program crashes 8.2.2 and HEAD (8.5.20171228).\r\n{{{#!hs\r\n{-# LANGUAGE TemplateHaskell #-}\r\nimport Language.Haskell.TH.Syntax (addTopDecls)\r\n$(do\r\n ds <- [d| f = Bool\r\n |]\r\n addTopDecls ds\r\n [d| g = cab\r\n |])\r\n}}}\r\nOutput:\r\n{{{\r\n Exception when trying to run compile-time code:\r\n ghc: panic! (the 'impossible' happened)\r\n (GHC version 8.5.20171228 for x86_64-unknown-linux):\r\n\tqAddTopDecls: can't convert top-level declarations\r\n\r\nIllegal variable name: ‘Bool’\r\nWhen splicing a TH declaration: f_0 = Bool\r\nCall stack:\r\n CallStack (from HasCallStack):\r\n callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in ghc:Outputable\r\n pprPanic, called at compiler/typecheck/TcSplice.hs:886:27 in ghc:TcSplice\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->
issue