#5959: GHC Panic: nameModule
-------------------------------+--------------------------------------------
Reporter: mightybyte | Owner: pcapriotti
Type: bug | Status: new
Priority: high | Milestone: 7.4.2
Component: Compiler | Version: 7.4.1
Keywords: | Os: Linux
Architecture: x86_64 (amd64) | Failure: Compile-time crash
Difficulty: Unknown | Testcase: th/T5971
Blockedby: | Blocking:
Related: |
-------------------------------+--------------------------------------------
Changes (by simonpj):
* testcase: => th/T5971
Comment:
New error message is:
{{{
T5959.hs:8:1:
The exact Name `b_aUU' is not in scope
Probable cause: you used a unique name (NameU) in Template Haskell
but did not bind it
}}}
This isn't as good as the new message in #5971, which is
{{{
T5971.hs:6:7:
The exact Name `x_aOV' is not in scope
Probable cause: you used newName in Template Haskell but did not
bind it
In the result of the splice:
$(newName "x" >>= varE)
To see what the splice expanded to, use -ddump-splices
In the expression: $(newName "x" >>= varE)
In a pattern binding: _ = $(newName "x" >>= varE)
}}}
Sadly there is a reason that it's not quite as good in this case. In this
case, #5959, there's a top-level declaration splice, which is renamed in a
mutually recursive group with the declarations that follow. So this
works:
{{{
$(f 4) -- Expands to: h x = g (x-1)
g x = h x
}}}
So the splice expands to a declaration that uses the declarations that
follow the splice.
I think it likely that this feature is never used, but it means that we
can't wrap the helpful context info around when we rename the splice
itself. Sigh.
I'm going to leave the ticket open for now... maybe it would be better to
rename and typecheck the result of a top-level splice all by itself?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5959#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs