changeset 79:37847b504cc6

More hardcore unification
author Adam Chlipala <adamc@hcoop.net>
date Sun, 29 Jun 2008 11:20:34 -0400
parents a6d45c6819c9
children 321cb9805c8e
files src/elaborate.sml tests/sig_impl.lac
diffstat 2 files changed, 33 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/elaborate.sml	Sun Jun 29 11:05:38 2008 -0400
+++ b/src/elaborate.sml	Sun Jun 29 11:20:34 2008 -0400
@@ -563,11 +563,8 @@
             end
 
         val (fs1, fs2) = eatMatching (fn ((x1, c1), (x2, c2)) =>
-                                         if consEq env (x1, x2) then
-                                             (unifyCons env c1 c2;
-                                              true)
-                                         else
-                                             false) (#fields s1, #fields s2)
+                                         consEq env (c1, c2) andalso consEq env (x1, x2))
+                                     (#fields s1, #fields s2)
         (*val () = eprefaces "Summaries2" [("#1", p_summary env {fields = fs1, unifs = #unifs s1, others = #others s1}),
                                            ("#2", p_summary env {fields = fs2, unifs = #unifs s2, others = #others s2})]*)
         val (unifs1, unifs2) = eatMatching (fn ((_, r1), (_, r2)) => r1 = r2) (#unifs s1, #unifs s2)
--- a/tests/sig_impl.lac	Sun Jun 29 11:05:38 2008 -0400
+++ b/tests/sig_impl.lac	Sun Jun 29 11:20:34 2008 -0400
@@ -25,3 +25,34 @@
 structure M : S = struct
         val x = fn v : int => {A = 0, B = "Hi"}
 end
+
+signature S = sig
+        con nm :: Name
+        con t :: Type
+        con r :: {Type}
+        val x : $([nm = t] ++ r)
+end
+
+structure M : S = struct
+        val x = {A = 0, B = "Hi"}
+end
+
+signature S = sig
+        con nm :: Name
+        con r :: {Type}
+        val x : $([nm = int] ++ r)
+end
+
+structure M : S = struct
+        val x = {A = 0, B = "Hi"}
+end
+
+signature S = sig
+        con nm :: Name
+        con r :: {Type}
+        val x : $([nm = string] ++ r)
+end
+
+structure M : S = struct
+        val x = {A = 0, B = "Hi"}
+end