
#9813: Error when reifying type constructor -------------------------------------+------------------------------------- Reporter: owst | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by goldfire): Template Haskell made no guarantees about the ordering of splice execution in 7.6.3, or of what definitions were available to `reify`. 7.8.3, on the other hand, says this (user manual, end of section 7.16.1):
The type environment seen by reify includes all the top-level declaration up to the end of the immediately preceding declaration group, but no more.
A declaration group is the group of declarations created by a top-level declaration splice, plus those following it, down to but not including the next top-level declaration splice. The first declaration group in a module includes all top-level definitions down to but not including the first top-level declaration splice.
So, I'd say that you were lucky that it worked in 7.6.3, but this is not erroneous behavior in 7.8.3. You can also fix the problem, by introducing a top-level splice, say {{{ $( return [] ) }}} After the declaration of `Huh`. Please close the ticket if you agree with my analysis. Thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9813#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler