# HG changeset patch # User Adam Chlipala # Date 1325801443 18000 # Node ID 2b7d3d99dc425519e07217de75c9d1ef7e192e56 # Parent 3e7c7e20071309a8bd48d9a1bb75b63731b3b3b2 Prevent unifications of 'others' pieces in record summaries, when both pieces contain unification variables (to prevent undesired unifications) diff -r 3e7c7e200713 -r 2b7d3d99dc42 src/elaborate.sml --- 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})]*)