
#14627: qAddTopDecls: can't convert top-level declarations -------------------------------------+------------------------------------- Reporter: tianxiaogu | Owner: mgsloan Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 8.2.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mgsloan): I've put up a patch that makes addTopDelcs no longer panic for conversion errors: https://phabricator.haskell.org/D4914 . Instead they are reported as normal errors like this: {{{ T14627.hs:3:3: error: qAddTopDecls: can't convert declarations: Illegal variable name: ‘Bool’ When splicing a TH declaration: f_0 = Bool | 3 | $(do | ^^... }}} Atop this, the error "Illegal variable name: 'Bool'" is quite poor, instead it should just say there's an out of scope constructor. I have a patch that fixes this and adds documentation to `UnboundVarE` clarifying this case. Can't push it to phabricator yet, though, because it appears to be down. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14627#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler