#4832: Inconsistent import of instances in GHCi ---------------------------+------------------------------------------------ Reporter: sebf | Owner: Type: bug | Status: closed Priority: high | Milestone: 7.4.1 Component: GHCi | Version: 7.0.1 Resolution: fixed | Keywords: Testcase: | Blockedby: Difficulty: | Os: Unknown/Multiple Blocking: | Architecture: Unknown/Multiple Failure: None/Unknown | ---------------------------+------------------------------------------------ Changes (by batterseapower):
* status: new => closed * resolution: => fixed Comment: Quite annoying to track down, but it is now fixed and pushed: {{{ commit 3deca8f44135bd1a146902f498189af00dd4d7b4 Author: Max Bolingbroke <batterseapo...@hotmail.com> Date: Sun Apr 3 16:50:47 2011 +0100 Use tcRnImports rather than rnImports with GHCi "import" statement: fixes #4 The bug here was that just using rnImports does not ensure that any dependen orphan modules are loaded, so instances declared by such modules will not be usable from the GHCi command line after an "import". This did not affect the :m syntax because it takes a different code path and uses getModuleExports directly, which contains its own calls to the orphan-m loading stuff. }}} I added a test as well. I think that mkExportEnv, hscGetModuleExports, getModuleExports, tcGetModuleExports could probably be deleted by just making the :m codepath a special case of the "import" codepath (in InteractiveEval.setContext), but I'm not familiar enough with the code to be confident about making that change. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4832#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs