comparison src/elab_err.sml @ 819:cb30dd2ba353

Switch to Maranget's pattern exhaustiveness algorithm
author Adam Chlipala <adamc@hcoop.net>
date Sat, 23 May 2009 09:45:02 -0400
parents d20d6afc1206
children e571fb150a9f
comparison
equal deleted inserted replaced
818:066493f7f008 819:cb30dd2ba353
159 | DuplicatePatternVariable of ErrorMsg.span * string 159 | DuplicatePatternVariable of ErrorMsg.span * string
160 | PatUnify of pat * con * con * cunify_error 160 | PatUnify of pat * con * con * cunify_error
161 | UnboundConstructor of ErrorMsg.span * string list * string 161 | UnboundConstructor of ErrorMsg.span * string list * string
162 | PatHasArg of ErrorMsg.span 162 | PatHasArg of ErrorMsg.span
163 | PatHasNoArg of ErrorMsg.span 163 | PatHasNoArg of ErrorMsg.span
164 | Inexhaustive of ErrorMsg.span 164 | Inexhaustive of ErrorMsg.span * pat
165 | DuplicatePatField of ErrorMsg.span * string 165 | DuplicatePatField of ErrorMsg.span * string
166 | Unresolvable of ErrorMsg.span * con 166 | Unresolvable of ErrorMsg.span * con
167 | OutOfContext of ErrorMsg.span * (exp * con) option 167 | OutOfContext of ErrorMsg.span * (exp * con) option
168 | IllegalRec of string * exp 168 | IllegalRec of string * exp
169 169
205 ErrorMsg.errorAt loc ("Unbound constructor " ^ String.concatWith "." (ms @ [s]) ^ " in pattern") 205 ErrorMsg.errorAt loc ("Unbound constructor " ^ String.concatWith "." (ms @ [s]) ^ " in pattern")
206 | PatHasArg loc => 206 | PatHasArg loc =>
207 ErrorMsg.errorAt loc "Constructor expects no argument but is used with argument" 207 ErrorMsg.errorAt loc "Constructor expects no argument but is used with argument"
208 | PatHasNoArg loc => 208 | PatHasNoArg loc =>
209 ErrorMsg.errorAt loc "Constructor expects argument but is used with no argument" 209 ErrorMsg.errorAt loc "Constructor expects argument but is used with no argument"
210 | Inexhaustive loc => 210 | Inexhaustive (loc, p) =>
211 ErrorMsg.errorAt loc "Inexhaustive 'case'" 211 (ErrorMsg.errorAt loc "Inexhaustive 'case'";
212 eprefaces' [("Missed case", p_pat env p)])
212 | DuplicatePatField (loc, s) => 213 | DuplicatePatField (loc, s) =>
213 ErrorMsg.errorAt loc ("Duplicate record field " ^ s ^ " in pattern") 214 ErrorMsg.errorAt loc ("Duplicate record field " ^ s ^ " in pattern")
214 | OutOfContext (loc, co) => 215 | OutOfContext (loc, co) =>
215 (ErrorMsg.errorAt loc "Type class wildcard occurs out of context"; 216 (ErrorMsg.errorAt loc "Type class wildcard occurs out of context";
216 Option.app (fn (e, c) => eprefaces' [("Function", p_exp env e), 217 Option.app (fn (e, c) => eprefaces' [("Function", p_exp env e),