登録: 2年前

完了: 13ヵ月前

#9648 closed bug (duplicate)

ghci fails to reload after deleting/creating an imported module

報告者: NeilMitchell 担当者:
優先度: normal マイルストーン:
コンポーネント: GHCi バージョン: 7.8.3
キーワード: 関係者: hvr, ndmitchell@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #11596 Differential Rev(s):
Wiki Page:

詳細 (最終更新者 thomie)

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 child 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     -- on Linux -->  :!rm Utils.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.

更新履歴 (4)

comment:1 更新者: NeilMitchell (2年前)

詳細: 更新 (差分)

comment:2 更新者: NeilMitchell (2年前)

関係者: ndmitchell@… を追加

comment:3 更新者: thomie (2年前)

詳細: 更新 (差分)

Still present in ghc-7.9.20141108. I edited the description to make it Linux compatible.

comment:4 更新者: thomie (13ヵ月前)

ステータス: newclosed
解決方法: duplicate

Let's continue this in #11596.

詳しい使い方は TracTickets を参照してください。