changeset 2099:8efba492c48b

Fix a bug in subsignature checking for submodules
author Adam Chlipala <adam@chlipala.net>
date Tue, 30 Dec 2014 17:02:31 -0500
parents b7cb53affc08
children e1724f279db7
files src/elaborate.sml
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/elaborate.sml	Fri Dec 26 12:30:22 2014 -0500
+++ b/src/elaborate.sml	Tue Dec 30 17:02:31 2014 -0500
@@ -3345,7 +3345,12 @@
                                      L'.SgiStr (x', n1, sgn1) =>
                                      if x = x' then
                                          let
+                                             (* Don't forget to save & restore the
+                                              * counterparts map around recursive calls!
+                                              * Otherwise, all sorts of mayhem may result. *)
+                                             val saved = !counterparts
                                              val () = subSgn' counterparts env loc sgn1 sgn2
+                                             val () = counterparts := saved
                                              val env = E.pushStrNamedAs env x n1 sgn1
                                              val env = if n1 = n2 then
                                                            env