diff src/elab_err.sml @ 1071:26197c957ad6

Better record summary error messages; more tweaking SQL usability
author Adam Chlipala <adamc@hcoop.net>
date Sun, 13 Dec 2009 11:28:47 -0500
parents 5d7e05b4a5c0
children c7b9a33c26c8
line wrap: on
line diff
--- a/src/elab_err.sml	Sun Dec 13 10:13:06 2009 -0500
+++ b/src/elab_err.sml	Sun Dec 13 11:28:47 2009 -0500
@@ -119,7 +119,7 @@
        | CIncompatible of con * con
        | CExplicitness of con * con
        | CKindof of kind * con * string
-       | CRecordFailure of con * con
+       | CRecordFailure of con * con * (con * con * con) option
 
 fun cunifyError env err =
     case err of
@@ -144,10 +144,16 @@
         eprefaces ("Unexpected kind for kindof calculation (expecting " ^ expected ^ ")")
                   [("Kind", p_kind env k),
                    ("Con", p_con env c)]
-      | CRecordFailure (c1, c2) =>
+      | CRecordFailure (c1, c2, fo) =>
         eprefaces "Can't unify record constructors"
-                  [("Summary 1", p_con env c1),
-                   ("Summary 2", p_con env c2)]
+                  (("Summary 1", p_con env c1)
+                   :: ("Summary 2", p_con env c2)
+                   :: (case fo of
+                           NONE => []
+                         | SOME (nm, t1, t2) =>
+                           [("Field", p_con env nm),
+                            ("Value 1", p_con env t1),
+                            ("Value 2", p_con env t2)]))
 
 datatype exp_error =
        UnboundExp of ErrorMsg.span * string