Fix hash calculation

This was resetting the current hash value so not calculating an
interface hash correctly, so sometimes not rebuilding when necessary.
This commit is contained in:
Edwin Brady 2020-02-10 14:22:12 +00:00
parent f9a3ed2e0c
commit a9db2b6754
2 changed files with 7 additions and 3 deletions

View File

@ -62,7 +62,7 @@ Hashable String where
export
Hashable Name where
hashWithSalt h (MN s _) = hashWithSalt h s
hashWithSalt h (Resolved i) = i
hashWithSalt h (Resolved i) = hashWithSalt h i
hashWithSalt h n = hashWithSalt h (show n)
export

View File

@ -70,8 +70,6 @@ readModule top loc vis reexp imp as
extendAs imp as syn
defs <- get Ctxt
when top $ put Ctxt (record { importHashes $= ((as, hash) ::) } defs)
modNS <- getNS
when vis $ setVisible imp
traverse_ (\ mimp =>
@ -241,6 +239,12 @@ processMod srcf ttcf msg mod sourcecode
setNS ns
errs <- logTime "Processing decls" $
processDecls (decls mod)
-- Save the import hashes for the imports we just read.
-- If they haven't changed next time, and the source
-- file hasn't changed, no need to rebuild.
defs <- get Ctxt
put Ctxt (record { importHashes = hs } defs)
pure (Just errs))
(\err => pure (Just [err]))