changeset 1657:2b7d3d99dc42

Prevent unifications of 'others' pieces in record summaries, when both pieces contain unification variables (to prevent undesired unifications)
author Adam Chlipala <adam@chlipala.net>
date Thu, 05 Jan 2012 17:10:43 -0500 (2012-01-05)
parents 3e7c7e200713
children de0a34e28bfa
files src/elaborate.sml
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/elaborate.sml	Mon Jan 02 17:08:39 2012 -0500
+++ b/src/elaborate.sml	Thu Jan 05 17:10:43 2012 -0500
@@ -865,7 +865,13 @@
 
          val (unifs1, unifs2) = eatMatching (fn ((_, r1), (_, r2)) => r1 = r2) (#unifs s1, #unifs s2)
 
-         val (others1, others2) = eatMatching (consEq env loc) (#others s1, #others s2)
+         val hasUnifs = U.Con.exists {kind = fn _ => false,
+                                      con = fn L'.CUnif _ => true
+                                             | _ => false}
+
+         val (others1, others2) = eatMatching (fn (c1, c2) =>
+                                                  not (hasUnifs c1 andalso hasUnifs c2)
+                                                  andalso consEq env loc (c1, c2)) (#others s1, #others s2)
          (*val () = eprefaces "Summaries3" [("#1", p_summary env {fields = fs1, unifs = unifs1, others = others1}),
                                           ("#2", p_summary env {fields = fs2, unifs = unifs2, others = others2})]*)