on master help sign in
Better message on IBC load failure
commit91cd4d54894c04d1594ba1efed552886beb74a84 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateMon 22 Dec 2014, 12:36 (12 years ago) parent40f6534
1 file changed+8−2
src/Idris/IBC.hs+8−2
src/Idris/IBC.hs+8−2
@@ -258,8 +258,14 @@ ibc i (IBCParsedRegion fc) f = return f { ibc_parsedSpan = Just fc }
258258process :: Bool -- ^ Reexporting
259259 -> IBCFile -> FilePath -> Idris ()
260260process reexp i fn
261− | ver i /= ibcVersion = do iLOG "ibc out of date"
262− ifail "Incorrect ibc version --- please rebuild"
261+ | ver i /= ibcVersion
262+ = do iLOG "ibc out of date"
263+ let e = if ver i < ibcVersion then " an earlier " else " a later "
264+ ifail $ "Incompatible ibc version.\nThis library was built with"
265+ ++ e ++ "version of Idris.\n" ++
266+ "Please clean and rebuild."
267+
268+ --- please rebuild"
263269 | otherwise =
264270 do srcok <- runIO $ doesFileExist (sourcefile i)
265271 when srcok $ timestampOlder (sourcefile i) fn