[GHC] #9648: ghci fails to reload after deleting/creating an imported module

GHC ghc-devs at haskell.org
Mon Sep 29 15:03:37 UTC 2014


#9648: ghci fails to reload after deleting/creating an imported module
-------------------------------------+-------------------------------------
       Reporter:  NeilMitchell       |                   Owner:
           Type:  bug                |                  Status:  new
       Priority:  normal             |               Milestone:
      Component:  GHCi               |                 Version:  7.8.3
       Keywords:                     |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Unknown            |         Type of failure:
     Blocked By:                     |  None/Unknown
Related Tickets:                     |               Test Case:
                                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 If you start GHCi with a 2 module program, delete the child module,
 reload, you get an error (as expected). If you recreate the child module
 and reload, it reloads the dependent module but erroneously claims that
 parent can't find the child.

 Note that if you rename the child to something else, then rename it back,
 then the test works - so it seems the reappearance and the file stamp
 confuses ghci. Spotted while working on ghcid:
 https://github.com/ndmitchell/ghcid

 {{{
 $ echo module Util where > Util.hs

 $ echo import Util; main = print 1 > Main.hs

 $ ghci Main.hs
 GHCi, version 7.8.3: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 [1 of 2] Compiling Util             ( Util.hs, interpreted )
 [2 of 2] Compiling Main             ( Main.hs, interpreted )
 Ok, modules loaded: Util, Main.
 *Main> :!del Util.hs
 *Main> :r

 Main.hs:1:8:
     Could not find module `Util'
     It is a member of the hidden package `ghc-7.8.3'.
     Use -v to see a list of the files searched for.
 Failed, modules loaded: Util, Main.
 *Main> :!echo module Util where > Util.hs
 *Main> :r
 [1 of 2] Compiling Util             ( Util.hs, interpreted )
 [2 of 2] Compiling Main             ( Main.hs, interpreted ) [Util
 changed]

 Main.hs:1:1:
     Failed to load interface for `Util'
     It is a member of the hidden package `ghc-7.8.3'.
     Use -v to see a list of the files searched for.
 Failed, modules loaded: Util.
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9648>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list