on master help sign in
Fixes #3023 with improved error message.

Improves error message for stale IBC files by adding the paths of the src and ibc file, together with their modification times.

commitad138e22749f05e943d1b48d4046753de11e2c8e authorJan de Muijnck-Hughes <jfdm@st-andrews.ac.uk> dateFri 8 Apr 2016, 21:15 (11 years ago) parent89401f2
1 file changed+11−5
src/Idris/IBC.hs+11−5
src/Idris/IBC.hs+11−5
@@ -394,11 +394,17 @@ process reexp phase archive fn = do
394394 processAccess reexp phase archive
395395
396396timestampOlder :: FilePath -> FilePath -> Idris ()
397−timestampOlder src ibc = do srct <- runIO $ getModificationTime src
398− ibct <- runIO $ getModificationTime ibc
399− if (srct > ibct)
400− then ifail $ "Needs reloading " ++ show (srct, ibct)
401− else return ()
397+timestampOlder src ibc = do
398+ srct <- runIO $ getModificationTime src
399+ ibct <- runIO $ getModificationTime ibc
400+ if (srct > ibct)
401+ then ifail $ unlines [ "Module needs reloading:"
402+ , unwords ["\tSRC :", show src]
403+ , unwords ["\tModified at:", show srct]
404+ , unwords ["\tIBC :", show src]
405+ , unwords ["\tModified at:", show srct]
406+ ]
407+ else return ()
402408
403409processPostulates :: Archive -> Idris ()
404410processPostulates ar = do