++ ", hspp = " ++ show (ml_hspp_file location));
(pcs_ch, errs_found, (recomp_reqd, maybe_checked_iface))
- <- checkOldIface dflags hit hst pcs
+ <- checkOldIface ghci_mode dflags hit hst pcs
(unJust "hscMain" (ml_hi_file location))
source_unchanged maybe_old_iface;
Provenance(..), ImportReason(..), initialVersionInfo,
Deprecations(..), lookupDeprec, lookupIface
)
+import CmStaticInfo ( GhciMode(..) )
import List ( partition, nub )
\end{code}
%************************************************************************
\begin{code}
-checkOldIface :: DynFlags
+checkOldIface :: GhciMode
+ -> DynFlags
-> HomeIfaceTable -> HomeSymbolTable
-> PersistentCompilerState
-> FilePath
-> IO (PersistentCompilerState, Bool, (RecompileRequired, Maybe ModIface))
-- True <=> errors happened
-checkOldIface dflags hit hst pcs iface_path source_unchanged maybe_iface
+checkOldIface ghci_mode dflags hit hst pcs iface_path source_unchanged maybe_iface
+
+ -- If the source has changed and we're in interactive mode, avoid reading
+ -- an interface; just return the one we might have been supplied with.
+ | ghci_mode == Interactive && not source_unchanged
+ = return (pcs, False, (outOfDate, maybe_iface))
+
+ | otherwise
= runRn dflags hit hst pcs (panic "Bogus module") $
case maybe_iface of
Just old_iface -> -- Use the one we already have
-- Nothing <=> file not found, or unreadable, or illegible
-- Just x <=> successfully found and parsed
readIface file_path
- = traceRn (ptext SLIT("readIFace") <+> text file_path) `thenRn_`
+ = --ioToRnM (putStrLn ("reading iface " ++ file_path)) `thenRn_`
+ traceRn (ptext SLIT("readIFace") <+> text file_path) `thenRn_`
ioToRnM (hGetStringBuffer False file_path) `thenRn` \ read_result ->
case read_result of {