comparison 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
comparison
equal deleted inserted replaced
1070:e933297c4e24 1071:26197c957ad6
117 CKind of kind * kind * kunify_error 117 CKind of kind * kind * kunify_error
118 | COccursCheckFailed of con * con 118 | COccursCheckFailed of con * con
119 | CIncompatible of con * con 119 | CIncompatible of con * con
120 | CExplicitness of con * con 120 | CExplicitness of con * con
121 | CKindof of kind * con * string 121 | CKindof of kind * con * string
122 | CRecordFailure of con * con 122 | CRecordFailure of con * con * (con * con * con) option
123 123
124 fun cunifyError env err = 124 fun cunifyError env err =
125 case err of 125 case err of
126 CKind (k1, k2, kerr) => 126 CKind (k1, k2, kerr) =>
127 (eprefaces "Kind unification failure" 127 (eprefaces "Kind unification failure"
142 ("Con 2", p_con env c2)] 142 ("Con 2", p_con env c2)]
143 | CKindof (k, c, expected) => 143 | CKindof (k, c, expected) =>
144 eprefaces ("Unexpected kind for kindof calculation (expecting " ^ expected ^ ")") 144 eprefaces ("Unexpected kind for kindof calculation (expecting " ^ expected ^ ")")
145 [("Kind", p_kind env k), 145 [("Kind", p_kind env k),
146 ("Con", p_con env c)] 146 ("Con", p_con env c)]
147 | CRecordFailure (c1, c2) => 147 | CRecordFailure (c1, c2, fo) =>
148 eprefaces "Can't unify record constructors" 148 eprefaces "Can't unify record constructors"
149 [("Summary 1", p_con env c1), 149 (("Summary 1", p_con env c1)
150 ("Summary 2", p_con env c2)] 150 :: ("Summary 2", p_con env c2)
151 :: (case fo of
152 NONE => []
153 | SOME (nm, t1, t2) =>
154 [("Field", p_con env nm),
155 ("Value 1", p_con env t1),
156 ("Value 2", p_con env t2)]))
151 157
152 datatype exp_error = 158 datatype exp_error =
153 UnboundExp of ErrorMsg.span * string 159 UnboundExp of ErrorMsg.span * string
154 | UnboundStrInExp of ErrorMsg.span * string 160 | UnboundStrInExp of ErrorMsg.span * string
155 | Unify of exp * con * con * cunify_error 161 | Unify of exp * con * con * cunify_error