diff src/elaborate.sml @ 1737:78d7cc9c9b18

Don't modify the module cache after elaboration failures
author Adam Chlipala <adam@chlipala.net>
date Wed, 02 May 2012 08:56:19 -0400
parents 7ec8dab190a7
children 1a35e75b6967
line wrap: on
line diff
--- a/src/elaborate.sml	Wed May 02 08:34:50 2012 -0400
+++ b/src/elaborate.sml	Wed May 02 08:56:19 2012 -0400
@@ -4461,6 +4461,8 @@
 
 fun elabFile basis basis_tm topStr topSgn top_tm env file =
     let
+        val () = ModDb.snapshot ()
+
         val () = mayDelay := true
         val () = delayedUnifs := []
         val () = delayedExhaustives := []
@@ -4788,6 +4790,11 @@
             end
         else
             ();
+
+        if ErrorMsg.anyErrors () then
+            ModDb.revert ()
+        else
+            ();
         
         (L'.DFfiStr ("Basis", basis_n, sgn), ErrorMsg.dummySpan)
         :: ds