diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-05-23 09:45:02 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-05-23 09:45:02 -0400 |
commit | cabd451f495af6f122b77c61903cc17ee7832d71 (patch) | |
tree | 61c0180868573d29dd2b29c2c065539368c79dc7 /src/elab_err.sml | |
parent | 32f6bd8f1bcf65a5db96160d63ef2050c9eb5e52 (diff) |
Switch to Maranget's pattern exhaustiveness algorithm
Diffstat (limited to 'src/elab_err.sml')
-rw-r--r-- | src/elab_err.sml | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/elab_err.sml b/src/elab_err.sml index 9eafa7df..dc34560b 100644 --- a/src/elab_err.sml +++ b/src/elab_err.sml @@ -161,7 +161,7 @@ datatype exp_error = | UnboundConstructor of ErrorMsg.span * string list * string | PatHasArg of ErrorMsg.span | PatHasNoArg of ErrorMsg.span - | Inexhaustive of ErrorMsg.span + | Inexhaustive of ErrorMsg.span * pat | DuplicatePatField of ErrorMsg.span * string | Unresolvable of ErrorMsg.span * con | OutOfContext of ErrorMsg.span * (exp * con) option @@ -207,8 +207,9 @@ fun expError env err = ErrorMsg.errorAt loc "Constructor expects no argument but is used with argument" | PatHasNoArg loc => ErrorMsg.errorAt loc "Constructor expects argument but is used with no argument" - | Inexhaustive loc => - ErrorMsg.errorAt loc "Inexhaustive 'case'" + | Inexhaustive (loc, p) => + (ErrorMsg.errorAt loc "Inexhaustive 'case'"; + eprefaces' [("Missed case", p_pat env p)]) | DuplicatePatField (loc, s) => ErrorMsg.errorAt loc ("Duplicate record field " ^ s ^ " in pattern") | OutOfContext (loc, co) => |