diff src/elaborate.sml @ 153:cfe6f9db74aa

radio and radioOption
author Adam Chlipala <adamc@hcoop.net>
date Thu, 24 Jul 2008 11:10:23 -0400
parents 67ab26888839
children 34ccd7d2bea8
line wrap: on
line diff
--- a/src/elaborate.sml	Thu Jul 24 10:41:53 2008 -0400
+++ b/src/elaborate.sml	Thu Jul 24 11:10:23 2008 -0400
@@ -445,7 +445,7 @@
        | CIncompatible of L'.con * L'.con
        | CExplicitness of L'.con * L'.con
        | CKindof of L'.kind * L'.con
-       | CRecordFailure
+       | CRecordFailure of PD.pp_desc * PD.pp_desc
 
 exception CUnify' of cunify_error
 
@@ -472,8 +472,10 @@
         eprefaces "Unexpected kind for kindof calculation"
                   [("Kind", p_kind k),
                    ("Con", p_con env c)]
-      | CRecordFailure =>
-        eprefaces "Can't unify record constructors" []
+      | CRecordFailure (s1, s2) =>
+        eprefaces "Can't unify record constructors"
+        [("Summary 1", s1),
+         ("Summary 2", s2)]
 
 exception SynUnif = E.SynUnif
 
@@ -677,12 +679,12 @@
                 if clear then
                     List.app (fn (_, r) => r := SOME empty) unifs2
                 else
-                    raise CUnify' CRecordFailure
+                    raise CUnify' (CRecordFailure (p_summary env s1, p_summary env s2))
               | (_, []) =>
                 if clear then
                     List.app (fn (_, r) => r := SOME empty) unifs1
                 else
-                    raise CUnify' CRecordFailure
+                    raise CUnify' (CRecordFailure (p_summary env s1, p_summary env s2))
               | ((c1, _) :: rest1, (_, r2) :: rest2) =>
                 (r2 := SOME c1;
                  pairOffUnifs (rest1, rest2))