diff options
author | Simon Marlow <marlowsd@gmail.com> | 2011-09-13 10:33:41 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2011-09-21 01:14:10 +0100 |
commit | 9de6f19e5de702967a9411b01c06734d3b67eea8 (patch) | |
tree | 0deee2693b35cb92b8258356eb84a424a175cca2 | |
parent | 5a369e7b9d99fb585aac1e994f7d180e2bc408ca (diff) | |
download | haskell-9de6f19e5de702967a9411b01c06734d3b67eea8.tar.gz |
In :load, call GHC.guessTarget on the new targets before unloading
Fixes this problem:
Prelude> :l foo
target `foo' is not a module name or a source file
>
-rw-r--r-- | ghc/InteractiveUI.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index 0dc32a7752..8b9e8192fc 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -1157,12 +1157,6 @@ loadModule_ fs = loadModule (zip fs (repeat Nothing)) >> return () loadModule' :: [(FilePath, Maybe Phase)] -> InputT GHCi SuccessFlag loadModule' files = do - -- unload first - _ <- GHC.abandonAll - lift discardActiveBreakPoints - GHC.setTargets [] - _ <- GHC.load LoadAllTargets - let (filenames, phases) = unzip files exp_filenames <- mapM expandPath filenames let files' = zip exp_filenames phases @@ -1173,6 +1167,12 @@ loadModule' files = do -- require some re-working of the GHC interface, so we'll leave it -- as a ToDo for now. + -- unload first + _ <- GHC.abandonAll + lift discardActiveBreakPoints + GHC.setTargets [] + _ <- GHC.load LoadAllTargets + GHC.setTargets targets doLoad False LoadAllTargets |