[GHC] #15783: Quoting an internal variable causes an error when splicing
GHC
ghc-devs at haskell.org
Fri Oct 19 14:47:26 UTC 2018
#15783: Quoting an internal variable causes an error when splicing
-------------------------------------+-------------------------------------
Reporter: mpickering | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.6.1
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
{{{
{-# LANGUAGE TemplateHaskell #-}
module A where
import B
main = $$f
}}}
{{{
{-# LANGUAGE TemplateHaskell #-}
module B(f) where
d = 0
f = [|| d ||]
}}}
Note that `d` is not exported from `B`.
{{{
[1 of 2] Compiling B ( B.hs, B.o )
[2 of 2] Compiling A ( A.hs, A.o )
A.hs:6:8: error:
• Can't find interface-file declaration for variable B.d
Probable cause: bug in .hi-boot file, or inconsistent .hi file
Use -ddump-if-trace to get an idea of which file caused the error
• In the expression: B.d
In the result of the splice:
$f
To see what the splice expanded to, use -ddump-splices
In the Template Haskell splice $$f
|
6 | main = $$f
| ^^^
}}}
This doesn't seem to happen for untyped quotes/splices.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15783>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list