[GHC] #13102: orphan family instances can leak through the EPS in --make mode
GHC
ghc-devs at haskell.org
Thu Feb 9 10:47:59 UTC 2017
#13102: orphan family instances can leak through the EPS in --make mode
-------------------------------------+-------------------------------------
Reporter: rwbarton | Owner: rwbarton
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by ezyang):
simonpj and I chatted about this, and we came up with a short term and a
long term solution.
* The short term solution is to special-case GHC.Exts so that it is always
visible. This should be pretty easy to do.
* But, if we look at how the compiler handles finding instances of wired
in things, there is a `checkWiredInTyCon` function which we specifically
call in order to bring in the instances for a wired in thing. So really,
the desired semantics are, if we call `checkWiredInTyCon` on a `TyCon`, we
want to act AS IF we had an implicit import of this `TyCon`. This means
checking it for family instance consistency (see #13251) and considering
it visible. But now that I think about it, it seems very awkward to
actually get this info to the list of visible info, since we won't really
bang on the TyCon until we're about to do an instance lookup; might be a
little fiddly to get that to work. But the long term solution is something
like this: an implicit reference to a wired in thing counts as an import
to that defining module.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13102#comment:15>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list