Commit 9de6f19e authored by Simon Marlow's avatar Simon Marlow

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
>
parent 5a369e7b
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment