summaryrefslogtreecommitdiff
path: root/src/elaborate.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-01-05 17:10:43 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2012-01-05 17:10:43 -0500
commit27ce2f2c70d02554bb477a23ef9f405a14d6650f (patch)
tree48850afc316723fe0ff8f0932c39a17a6c6a1967 /src/elaborate.sml
parentfe2d1fe8ab56f83796a80bcb370d7420e693ab2a (diff)
Prevent unifications of 'others' pieces in record summaries, when both pieces contain unification variables (to prevent undesired unifications)
Diffstat (limited to 'src/elaborate.sml')
-rw-r--r--src/elaborate.sml8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/elaborate.sml b/src/elaborate.sml
index b15ef1c4..89c077e5 100644
--- a/src/elaborate.sml
+++ b/src/elaborate.sml
@@ -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})]*)